Skip to content

Commit 258691d

Browse files
authored
Fix more slugs after Astro upgrade, fixes #294 (#295)
1 parent 2f74a97 commit 258691d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/BlogPostFooter.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const orderedPosts = posts.sort((a, b) => {
1414
})
1515
1616
orderedPosts.forEach((post, index) => {
17-
if (post.slug === activeSlug) {
17+
if (post.id === activeSlug) {
1818
if (posts[index - 1]) {
1919
prev = posts[index - 1]
2020
}
@@ -32,7 +32,7 @@ orderedPosts.forEach((post, index) => {
3232
{
3333
prev && (
3434
<a
35-
href={`/blog/${prev.slug}`}
35+
href={`/blog/${prev.id}`}
3636
rel="prefetch"
3737
class="flex border items-center rounded-md w-full my-1 md:my-0 content-center justify-start md:justify-start p-4 hover:border-blue-300 hover:shadow-sm dark:border-slate-700"
3838
title={`Previous: ${prev.data.title}`}
@@ -49,7 +49,7 @@ orderedPosts.forEach((post, index) => {
4949
{
5050
next && (
5151
<a
52-
href={`/blog/${next.slug}`}
52+
href={`/blog/${next.id}`}
5353
rel="prefetch"
5454
class="flex border items-center rounded-md w-full my-1 md:my-0 content-center justify-start md:justify-end md:text-right p-4 hover:border-blue-300 hover:shadow-sm dark:border-slate-700"
5555
title={`Next: ${next.data.title}`}

src/pages/blog/rss.xml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const items = recentPosts.map((post) => {
3939
postContent += ensureAbsoluteUrls(marked.parse(post.body))
4040

4141
return {
42-
link: `${blogUrl}/${post.slug}`,
42+
link: `${blogUrl}/${post.id}`,
4343
title: post.data.title,
4444
description: post.data.summary,
4545
categories: post.data.categories,

0 commit comments

Comments
 (0)