mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
feat: add basic page for Haiku detail pages
This commit is contained in:
21
src/pages/haiku/[...slug].astro
Normal file
21
src/pages/haiku/[...slug].astro
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||
import { Verse } from '../../components';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const haikuEntries = await getCollection('haiku');
|
||||
return haikuEntries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout title={`Haiku ${entry.slug}`} backLink="/haiku/" navigation={false} footer={false}>
|
||||
<Verse>{entry.data.de}</Verse>
|
||||
<Verse>{entry.data.en}</Verse>
|
||||
</BaseLayout>
|
||||
Reference in New Issue
Block a user