Files
bincio-wiki-site/src/pages/entries/[...slug].astro
T

22 lines
557 B
Plaintext

---
import { type CollectionEntry, getCollection, render } from 'astro:content';
import Entry from '../../layouts/Entry.astro';
export async function getStaticPaths() {
const entries = await getCollection('entries');
return entries.map((entry) => ({
params: { slug: entry.id },
props: entry,
}));
}
type Props = CollectionEntry<'entries'>;
const entry = Astro.props;
const { Content, remarkPluginFrontmatter } = await render(entry);
entry.data.frontmatter = remarkPluginFrontmatter;
---
<Entry {...entry.data} id={entry.id}>
<Content />
</Entry>