diff --git a/src/pages/post/[...slug].astro b/src/pages/post/[...slug].astro index 63c5b27..b144a64 100644 --- a/src/pages/post/[...slug].astro +++ b/src/pages/post/[...slug].astro @@ -1,64 +1,75 @@ --- -import { getCollection, type CollectionEntry } from 'astro:content'; -import { Icon } from 'astro-icon/components'; -import Layout from '../../layouts/Layout.astro'; +import { getCollection, type CollectionEntry } from "astro:content"; +import { Icon } from "astro-icon/components"; +import Layout from "../../layouts/Layout.astro"; export const prerender = true; export async function getStaticPaths() { - const posts = await getCollection('posts'); - return posts.map((post: CollectionEntry<'posts'>) => ({ - params: { slug: post.slug }, - props: { post }, - })); + const posts = await getCollection("posts"); + return posts.map((post: CollectionEntry<"posts">) => ({ + params: { slug: post.slug }, + props: { post }, + })); } -const { post }: { post: CollectionEntry<'posts'> } = Astro.props; +const { post }: { post: CollectionEntry<"posts"> } = Astro.props; const { Content } = await post.render(); --- -
-
-
-

- {post.data.title} -

+
+
+
+

+ {post.data.title} +

-
-
- - -
+
+
+ + +
- {/* Back button */} - - - Back - + {/* Back button */} + + + Back + +
+ + { + post.data.tags && post.data.tags.length > 0 && ( +
+ {post.data.tags.map((tag: string) => ( +
+ + {tag} +
+ ))} +
+ ) + } + +
+ +
+
- - {post.data.tags && post.data.tags.length > 0 && ( -
- {post.data.tags.map((tag: string) => ( - - - {tag} - - ))} -
- )} - -
- -
-
-
- \ No newline at end of file +