From fe064e81bf9b77a7e14b715bb5f328bb143379db Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Mon, 24 Apr 2023 16:16:25 +0200 Subject: [PATCH] feat: add basic page for Haiku detail pages --- src/pages/haiku/[...slug].astro | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/pages/haiku/[...slug].astro diff --git a/src/pages/haiku/[...slug].astro b/src/pages/haiku/[...slug].astro new file mode 100644 index 0000000..5426708 --- /dev/null +++ b/src/pages/haiku/[...slug].astro @@ -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; +--- + + + {entry.data.de} + {entry.data.en} +