Skip to content

Commit

Permalink
fix: feed link slug
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoppippi committed Dec 8, 2024
1 parent d36c37e commit 720fb0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/routes/blog/feed.xml/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ export const GET = (async () => {
if (!post.isPublished) {
continue;
}
const slug = post.filepath.split('/').at(-1)?.replace(/\.md$/, '');

if (slug == null) {
continue;
}

feed.addItem({
link: subdomain('blog', post.slug),
link: subdomain('blog', slug),
date: new Date(post.pubDate),
title: post.title,
description: `${post.title} | ${post.readingTime.text}`,
Expand Down

0 comments on commit 720fb0c

Please sign in to comment.