cozy/src/components/blog/BaseHead.astro

49 lines
1.5 KiB
Text

---
import '../../styles/reset.css';
import '../../styles/blog.css';
import { SITE_TITLE, SITE_AUTHOR, SITE_DESCRIPTION } from '../../consts';
interface Props {
title: string;
description: string;
isArticle?: boolean;
image?: string;
}
let {isArticle = false, title, description = 'default description', image = '/cozy.jpg' } = Astro.props;
description = title === SITE_TITLE
? SITE_DESCRIPTION
: `${SITE_TITLE} • ${description}`
---
<!-- Global Metadata -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="generator" content={Astro.generator} />
<!-- Font preloads -->
<link rel="preload" href="/fonts/atkinson-regular.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin />
<!-- Primary Meta Tags -->
<title>{title} • {description}</title>
<meta name="title" content={title} />
<meta name="description" content={description} />
<!-- Open Graph / Facebook -->
{
isArticle
? <meta property="og:type" content="article" />
: <meta property="og:type" content="website" />
}
<meta property="og:url" content={Astro.url} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={new URL(image, Astro.url)} />
<meta property="og:site_name" content={SITE_TITLE} />
<meta property="article:author" content={SITE_AUTHOR} />