diff --git a/src/pages/cats/[...catId].astro b/src/pages/cats/[...catId].astro new file mode 100644 index 0000000..91eca49 --- /dev/null +++ b/src/pages/cats/[...catId].astro @@ -0,0 +1,59 @@ +--- +import { getCollection, type CollectionEntry } from 'astro:content'; + +import BaseLayout from '../../layouts/BaseLayout.astro'; + +type Props = CollectionEntry<'cats'>; + +export async function getStaticPaths() { + const cats = await getCollection('cats'); + + return cats.map((cat) => ({ + params: { catId: cat.id }, + props: cat + })); +} + +const cat = Astro.props; +const title = `${cat.data.owner.name}'s ${cat.data.name}`; +--- + + +

+ {cat.data.name} +

+

+ Owner - {cat.data.owner.name} +

+
+
+ {cat.data.image.alt} +
+
+

+ {cat.data.description} +

+
+
+
+ +