62 lines
1.9 KiB
Plaintext
62 lines
1.9 KiB
Plaintext
---
|
|
import { Font } from 'astro:assets'
|
|
|
|
import type { Article } from '@/lib/site/types'
|
|
|
|
import '@/styles/global.css'
|
|
|
|
import SiteFooter from '@/components/site/SiteFooter.astro'
|
|
import SiteHeader from '@/components/site/SiteHeader.astro'
|
|
import { resolveImage } from '@/lib/images/resolve'
|
|
|
|
interface Props {
|
|
title: string
|
|
description?: string
|
|
image?: string
|
|
noindex?: boolean
|
|
article?: Article
|
|
}
|
|
|
|
const { title, description, image, noindex, article } = Astro.props
|
|
const canonical = new URL(Astro.url.pathname, Astro.site)
|
|
const preview = image ? resolveImage(image) : undefined
|
|
const previewUrl = preview ? new URL(preview.src, Astro.site) : undefined
|
|
---
|
|
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="generator" content={Astro.generator} />
|
|
|
|
<title>{title}</title>
|
|
{description && <meta name="description" content={description} />}
|
|
{noindex && <meta name="robots" content="noindex" />}
|
|
<link rel="canonical" href={canonical} />
|
|
|
|
<meta property="og:type" content="website" />
|
|
<meta property="og:title" content={title} />
|
|
<meta property="og:url" content={canonical} />
|
|
{description && <meta property="og:description" content={description} />}
|
|
{previewUrl && <meta property="og:image" content={previewUrl} />}
|
|
<meta name="twitter:card" content={previewUrl ? 'summary_large_image' : 'summary'} />
|
|
<slot name="head" />
|
|
<Font cssVariable="--font-geist" preload />
|
|
<Font cssVariable="--font-geist-mono" preload />
|
|
<Font cssVariable="--font-blaka" preload />
|
|
<Font cssVariable="--font-julia-mono" preload />
|
|
<Font cssVariable="--font-unigrim" />
|
|
<style is:inline>
|
|
@layer reset, tokens, base, components.prose, components.blocks, utilities;
|
|
</style>
|
|
</head>
|
|
<body class="ui">
|
|
<SiteHeader article={article} />
|
|
<main>
|
|
<slot />
|
|
</main>
|
|
<SiteFooter />
|
|
</body>
|
|
</html>
|