First release.

This commit is contained in:
2024-06-08 23:05:48 +08:00
commit f04ca4a96b
31 changed files with 7699 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
---
import { getCollection } from "astro:content";
import type {
CollectionEntry,
CollectionKey,
ContentEntryMap,
} from "astro:content";
import Footer from "../../../components/Footer.astro";
import Nav from "../../../components/Nav.astro";
import ArticleBody from "../../../components/article/ArticleBody.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
export async function getStaticPaths() {
const collectionName: CollectionKey = "blog";
const blogEntries = await getCollection(collectionName);
return blogEntries.map((entry) => ({
params: { blog: entry.slug },
props: { entry },
}));
}
interface Props {
entry: CollectionEntry<keyof ContentEntryMap>;
}
const { entry } = Astro.props;
const articlePrettyName:string = entry.id.split("/").pop()!.replace(".md", "");
---
<DefaultLayout title=`${articlePrettyName} - 李守中`>
<Nav />
<ArticleBody collectionName="blog" articleSlug={entry.slug} />
<Footer />
</DefaultLayout>