ld-site/src/pages/article/translation/[...translation].astro
liding a8f0a86e07 Join lines broken by newlines to a long line.
Join paragraph lines that are broken by newlines from a long paragraph to a
long line. If the current line is a part of a block area, like pre, code,
blockquote, skip it.
2024-06-30 09:13:57 +08:00

35 lines
1.0 KiB
Plaintext

---
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 ArticleBodyWrapper from "../../../components/article/article_body/ArticleBodyWrapper.astro";
import DefaultLayout from "../../../layouts/DefaultLayout.astro";
export async function getStaticPaths() {
const collectionName: CollectionKey = "translation";
const blogEntries = await getCollection(collectionName);
return blogEntries.map((entry) => ({
params: { translation: 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 />
<ArticleBodyWrapper collectionName="translation" articleSlug={entry.slug} />
<Footer />
</DefaultLayout>