diff --git a/src/components/Post.astro b/src/components/Post.astro index f558db9..c87bd2e 100644 --- a/src/components/Post.astro +++ b/src/components/Post.astro @@ -3,14 +3,18 @@ export interface Props { title: string; publishDate: Date; tags: string[]; + slug: string; } -const { title, publishDate, tags } = Astro.props; +const { title, publishDate, tags, slug } = Astro.props; ---
-

+

{ publishDate.toLocaleDateString('en-US', { month: 'long', @@ -20,11 +24,21 @@ const { title, publishDate, tags } = Astro.props; }

-

{title}

+

+ {title} +

{ tags ? ( -
+
{tags.map( (tag: string) => {tag}, // prettier-ignore diff --git a/src/components/PostPreview.astro b/src/components/PostPreview.astro index bcef608..112ce1b 100644 --- a/src/components/PostPreview.astro +++ b/src/components/PostPreview.astro @@ -17,6 +17,7 @@ const { post } = Astro.props;

{ new Date(post.data.publishDate).toLocaleDateString('en-US', { @@ -27,14 +28,17 @@ const { post } = Astro.props; }

-

+

{post.data.title}

{ post.data.tags ? ( -
+
{post.data.tags.map((tag) => ( {tag} ))} diff --git a/src/layouts/Page.astro b/src/layouts/Page.astro index 3c88e98..f689e59 100644 --- a/src/layouts/Page.astro +++ b/src/layouts/Page.astro @@ -1,4 +1,6 @@ --- +import { ViewTransitions } from 'astro:transitions'; + import BaseHead from '@/components/BaseHead.astro'; import PageHeader from '@/components/PageHeader.astro'; @@ -9,6 +11,7 @@ const { title, description } = content; + diff --git a/src/layouts/PostLayout.astro b/src/layouts/PostLayout.astro index 3167f47..54bb85c 100644 --- a/src/layouts/PostLayout.astro +++ b/src/layouts/PostLayout.astro @@ -1,5 +1,6 @@ --- import type { CollectionEntry } from 'astro:content'; +import { ViewTransitions } from 'astro:transitions'; import BaseHead from '@/components/BaseHead.astro'; import Logo from '@/components/Logo.astro'; @@ -10,6 +11,7 @@ type Props = { frontmatter: CollectionEntry<'posts'>['data']; }; +const { slug } = Astro.params as { slug: string }; const { frontmatter } = Astro.props; const { title, description, publishDate, tags } = frontmatter; --- @@ -17,6 +19,7 @@ const { title, description, publishDate, tags } = frontmatter; + @@ -24,7 +27,7 @@ const { title, description, publishDate, tags } = frontmatter;
- +