142 lines
4 KiB
Text
142 lines
4 KiB
Text
---
|
|
import Jumbotron from '../components/Jumbotron.astro'
|
|
import { ArticleData } from '@extractus/article-extractor'
|
|
import '../styles/reset.css'
|
|
import '../styles/variables.css'
|
|
|
|
export interface Props {
|
|
article: ArticleData | null
|
|
}
|
|
|
|
const { article } = Astro.props
|
|
const appTitle = article?.title ? `${article.title} | Cozy` : 'Cozy'
|
|
---
|
|
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>{appTitle}</title>
|
|
|
|
{
|
|
/**
|
|
* if showing a post:
|
|
* - don't allow search engines to index the page
|
|
* - add cozy metadata for the app to use
|
|
*/
|
|
article && article?.url !== '/' ? (
|
|
<>
|
|
<meta name="robots" content="noindex" />
|
|
<meta name="googlebot" content="noindex" />
|
|
|
|
<meta property="og:title" content={`${appTitle}- ${article.title}`} />
|
|
<meta property="og:url" content={Astro.url.href} />
|
|
<meta property="og:image" content="/touch-icon-large.png" />
|
|
<meta
|
|
property="og:site_name"
|
|
content={`${appTitle}- ${article.title}`}
|
|
/>
|
|
<meta property="article:author" content={article.author} />
|
|
<meta property="og:description" content={article.description} />
|
|
<meta name="description" content={article.description} />
|
|
|
|
<meta property="cozy:title" content={article.title} />
|
|
<meta property="cozy:url" content={article.url} />
|
|
<meta property="cozy:description" content={article.description} />
|
|
<meta property="cozy:image" content={article.image} />
|
|
<meta property="cozy:source" content={article.source} />
|
|
<meta property="cozy:author" content={article.author} />
|
|
<meta property="cozy:published" content={article.published} />
|
|
</>
|
|
) : (
|
|
<>
|
|
<meta property="og:title" content={appTitle} />
|
|
<meta property="og:url" content={Astro.url.href} />
|
|
<meta property="og:image" content="/touch-icon-large.png" />
|
|
<meta
|
|
property="og:description"
|
|
content="Remove distractions. Save your favorites. Get useful insights. Cozy is your modern-day reading companion."
|
|
/>
|
|
<meta
|
|
name="description"
|
|
content="Remove distractions. Save your favorites. Get useful insights. Cozy is your modern-day reading companion."
|
|
/>
|
|
<meta
|
|
itemprop="description"
|
|
content="Remove distractions. Save your favorites. Get useful insights. Cozy is your modern-day reading companion."
|
|
/>
|
|
</>
|
|
)
|
|
}
|
|
|
|
<!-- Icons -->
|
|
<link rel="icon" href="favicon.svg" />
|
|
<link rel="mask-icon" href="mask-icon.svg" color="#000000" />
|
|
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
|
|
</head>
|
|
<body>
|
|
<div id="app-wrapper">
|
|
<Jumbotron />
|
|
<slot />
|
|
<div id="main-content">
|
|
<div id="post-wrapper">
|
|
<slot name="post" />
|
|
</div>
|
|
<div id="library-wrapper">
|
|
<slot name="library" />
|
|
</div>
|
|
</div>
|
|
<slot name="footer" />
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|
|
<style>
|
|
body {
|
|
display: grid;
|
|
place-content: safe center;
|
|
}
|
|
|
|
#app-wrapper {
|
|
padding: 0.5em 0.5em 10em;
|
|
--app-width: 650px;
|
|
max-width: var(--app-width);
|
|
width: 100%;
|
|
display: grid;
|
|
gap: 1em;
|
|
|
|
#main-content {
|
|
max-width: calc(var(--app-width) - 2em);
|
|
padding: 0 1em;
|
|
|
|
@media (max-width: 650px) {
|
|
max-width: calc(100vw - 2em);
|
|
padding: 0;
|
|
}
|
|
|
|
& table {
|
|
overflow-x: auto;
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
&:has(#router-outlet #post) {
|
|
#jumbotron {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
<style is:global>
|
|
:root {
|
|
--system-ui:
|
|
system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
|
|
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
}
|
|
|
|
html * {
|
|
font-family: var(--system-ui);
|
|
}
|
|
</style>
|