Skip to content

Commit

Permalink
Fix more slugs after Astro upgrade, fixes #294 (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
stasadev authored Dec 23, 2024
1 parent 2f74a97 commit 258691d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/BlogPostFooter.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const orderedPosts = posts.sort((a, b) => {
})
orderedPosts.forEach((post, index) => {
if (post.slug === activeSlug) {
if (post.id === activeSlug) {
if (posts[index - 1]) {
prev = posts[index - 1]
}
Expand All @@ -32,7 +32,7 @@ orderedPosts.forEach((post, index) => {
{
prev && (
<a
href={`/blog/${prev.slug}`}
href={`/blog/${prev.id}`}
rel="prefetch"
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"
title={`Previous: ${prev.data.title}`}
Expand All @@ -49,7 +49,7 @@ orderedPosts.forEach((post, index) => {
{
next && (
<a
href={`/blog/${next.slug}`}
href={`/blog/${next.id}`}
rel="prefetch"
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"
title={`Next: ${next.data.title}`}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/rss.xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const items = recentPosts.map((post) => {
postContent += ensureAbsoluteUrls(marked.parse(post.body))

return {
link: `${blogUrl}/${post.slug}`,
link: `${blogUrl}/${post.id}`,
title: post.data.title,
description: post.data.summary,
categories: post.data.categories,
Expand Down

0 comments on commit 258691d

Please sign in to comment.