fix(blog): slug should be id
This commit is contained in:
parent
113248b6ed
commit
f6bae8d43c
2 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ import Blog from '../../layouts/Blog.astro'
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const posts = await getCollection('blog')
|
const posts = await getCollection('blog')
|
||||||
return posts.map((post) => ({
|
return posts.map((post) => ({
|
||||||
params: { slug: post.slug },
|
params: { id: post.id },
|
||||||
props: post,
|
props: post,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
|
@ -115,7 +115,7 @@ const posts = (await getCollection('blog')).sort(
|
||||||
<FormattedDate date={post.data.pubDate} />
|
<FormattedDate date={post.data.pubDate} />
|
||||||
</small>
|
</small>
|
||||||
<h4 class="title">
|
<h4 class="title">
|
||||||
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
|
<a href={`/blog/${post.id}/`}>{post.data.title}</a>
|
||||||
</h4>
|
</h4>
|
||||||
<p class="description">{post.data.description}</p>
|
<p class="description">{post.data.description}</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in a new issue