mirror of
https://github.com/avinal/avinal.github.io.git
synced 2026-07-04 07:40:09 +05:30
f90901ef65
- remove hugo and paper box theme - inspiration https://jay.fish - use astro based system Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
73 lines
2.1 KiB
Plaintext
73 lines
2.1 KiB
Plaintext
---
|
|
import Nav from "@/components/Nav.astro";
|
|
import Footer from "@/components/Footer.astro";
|
|
import theme, { generateThemeCSS } from "@/config/theme";
|
|
import "@/styles/global.css";
|
|
|
|
interface Props {
|
|
title: string;
|
|
description?: string;
|
|
ogImage?: string;
|
|
}
|
|
|
|
const {
|
|
title,
|
|
description = theme.site.description,
|
|
ogImage,
|
|
} = Astro.props;
|
|
|
|
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
|
const siteName = theme.site.title;
|
|
const themeCSS = generateThemeCSS(theme);
|
|
---
|
|
|
|
<!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 === "Home" ? siteName : `${title} — ${siteName}`}</title>
|
|
<meta name="description" content={description} />
|
|
<link rel="canonical" href={canonicalURL} />
|
|
|
|
<!-- Open Graph -->
|
|
<meta property="og:type" content="website" />
|
|
<meta property="og:url" content={canonicalURL} />
|
|
<meta property="og:title" content={title} />
|
|
<meta property="og:description" content={description} />
|
|
<meta property="og:site_name" content={siteName} />
|
|
{ogImage && <meta property="og:image" content={ogImage} />}
|
|
|
|
<!-- Favicon -->
|
|
<link rel="icon" type="image/svg+xml" href="/logo-static.svg" />
|
|
<link rel="sitemap" href="/sitemap-index.xml" />
|
|
<link rel="alternate" type="application/rss+xml" title="Avinal Kumar" href="/rss.xml" />
|
|
|
|
<!-- Design tokens generated from theme config -->
|
|
<style set:html={themeCSS} />
|
|
|
|
<!-- Theme: prevent flash by reading preference before paint -->
|
|
<script is:inline>
|
|
(function () {
|
|
const stored = localStorage.getItem("theme");
|
|
if (stored) {
|
|
document.documentElement.setAttribute("data-theme", stored);
|
|
} else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
document.documentElement.setAttribute("data-theme", "dark");
|
|
}
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="page-wrapper">
|
|
<Nav />
|
|
<main class="main-content">
|
|
<slot />
|
|
</main>
|
|
<Footer />
|
|
</div>
|
|
</body>
|
|
</html>
|