diff --git a/src/layouts/Post.astro b/src/layouts/Post.astro index 81e3763..32f3097 100644 --- a/src/layouts/Post.astro +++ b/src/layouts/Post.astro @@ -1,12 +1,14 @@ --- import Base from "@layouts/Base.astro"; import { type CollectionEntry } from 'astro:content'; +import { format } from "date-fns"; interface Props { post: CollectionEntry<'blog'>; } const { post } = Astro.props; const { title, pubDate, tags } = post.data; +const tagCount = tags.length; ---
@@ -15,20 +17,17 @@ const { title, pubDate, tags } = post.data; {title} - -

- +

- - {tags.map((tag) => ( - { tag } + {tags.map((tag, i) => ( + <>{ tag }{ i < tagCount - 1 ? ',' : ''} ))} -