fix(blog): slug should be id

This commit is contained in:
Ayo Ayco 2025-01-11 10:56:41 +01:00
parent 113248b6ed
commit f6bae8d43c
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@ import Blog from '../../layouts/Blog.astro'
export async function getStaticPaths() {
const posts = await getCollection('blog')
return posts.map((post) => ({
params: { slug: post.slug },
params: { id: post.id },
props: post,
}))
}

View file

@ -115,7 +115,7 @@ const posts = (await getCollection('blog')).sort(
<FormattedDate date={post.data.pubDate} />
</small>
<h4 class="title">
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
<a href={`/blog/${post.id}/`}>{post.data.title}</a>
</h4>
<p class="description">{post.data.description}</p>
</li>