main
 1---
 2import "@/styles/global.css";
 3import Footer from "@/components/Footer.astro";
 4import Header from "@/components/Header.astro";
 5import { SITE_CONFIG } from "@/config";
 6import { url } from "@/utils/url";
 7import { Font } from "astro:assets";
 8
 9interface Props {
10  title?: string;
11  author?: string;
12  description?: string;
13  isArticle?: boolean;
14}
15
16const {
17  title = SITE_CONFIG.title,
18  author = SITE_CONFIG.author,
19  description = SITE_CONFIG.description,
20  isArticle = false,
21} = Astro.props;
22---
23
24<html lang="en">
25  <head>
26    <meta charset="utf-8" />
27    <meta name="viewport" content="width=device-width" />
28    <meta name="generator" content={Astro.generator} />
29
30    <link rel="icon" type="image/svg+xml" href={url("/favicon.svg")} />
31    <link rel="icon" href={url("/favicon.ico")} />
32
33    <title>{title}</title>
34    <meta name="title" content={title} />
35    <meta name="description" content={description} />
36    <meta name="author" content={author} />
37
38    <meta property="og:url" content={Astro.url} />
39    <meta property="og:site_name" content={SITE_CONFIG.title} />
40    <meta property="og:title" content={title} />
41    <meta property="og:description" content={description} />
42    <meta property="og:type" content={isArticle ? "article" : "website"} />
43
44    <meta property="twitter:card" content="summary" />
45    <meta property="twitter:title" content={title} />
46    <meta property="twitter:description" content={description} />
47
48    <link
49      rel="alternate"
50      type="application/atom+xml"
51      title="Atom Feed"
52      href={url("/feed.atom")}
53    />
54    <link rel="sitemap" href={url("/sitemap-index.xml")} />
55
56    <Font cssVariable="--font-libertinus-serif" preload />
57    <link
58      rel="stylesheet"
59      href="https://fred-wang.github.io/MathFonts/NewComputerModern/mathfonts.css"
60    />
61  </head>
62  <body class="mx-auto px-4 max-w-268 font-serif">
63    <Header />
64    <main class="mt-16">
65      <slot />
66    </main>
67    <Footer />
68  </body>
69</html>