diff --git a/src/layouts/BlogPost.astro b/src/layouts/BlogPost.astro index c708b29..b1d9253 100644 --- a/src/layouts/BlogPost.astro +++ b/src/layouts/BlogPost.astro @@ -5,34 +5,78 @@ import FormattedDate from '../components/FormattedDate.astro'; import NotchedBox from '../components/NotchedBox.astro'; import { Image } from 'astro:assets'; -type Props = CollectionEntry<'blog'>['data']; +type Props = CollectionEntry<'blog'>['data'] & { slug: string; }; -const { title, description, pubDate, updatedDate, heroImage } = Astro.props; +const { slug, title, description, pubDate, updatedDate, heroImage, tags } = Astro.props; --- +
-
+
{heroImage && }
+
-
- { pubDate && } - { - updatedDate && ( -
- Last updated on -
- ) - } -
-

{title}

-
+

{title}

- + { tags && +
+ { + tags.map(tag => + #{tag} + ) + } +
+ } +
+
+ +
diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 096bd1e..f1df9eb 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -13,9 +13,10 @@ export async function getStaticPaths() { type Props = CollectionEntry<'blog'>; const post = Astro.props; +const { slug } = Astro.params; const { Content } = await render(post); --- - +