feat: some shit
This commit is contained in:
41
src/layouts/Layout.astro
Normal file
41
src/layouts/Layout.astro
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
import LanguagePicker from "../components/LanguagePicker.astro";
|
||||
import Nav from "../components/Nav.astro";
|
||||
interface Props {
|
||||
title: string;
|
||||
}
|
||||
|
||||
const { title } = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="description" content="Astro description" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="stylesheet" href="/app.css" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<!-- <meta http-equiv="refresh" content="0;url=/" /> -->
|
||||
<title>{title}</title>
|
||||
<script>
|
||||
(function () {
|
||||
try {
|
||||
var mode = localStorage.getItem("mode");
|
||||
var supportDarkMode =
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches === true;
|
||||
if (!mode && supportDarkMode)
|
||||
document.body.classList.add("theme-dark");
|
||||
if (!mode) return;
|
||||
document.body.classList.add("theme-" + mode);
|
||||
} catch (e) {}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<Nav />
|
||||
<slot />
|
||||
<LanguagePicker />
|
||||
</body>
|
||||
</html>
|
20
src/layouts/Post.astro
Normal file
20
src/layouts/Post.astro
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
import Layout from "./Layout.astro";
|
||||
|
||||
type Props = CollectionEntry<"blog">["data"];
|
||||
|
||||
const { title } = Astro.props;
|
||||
---
|
||||
|
||||
<Layout title={title}>
|
||||
<article>
|
||||
<div class="prose">
|
||||
<div class="title">
|
||||
<h1>{title}</h1>
|
||||
<hr />
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
</article>
|
||||
</Layout>
|
Reference in New Issue
Block a user