Skip to content

Commit 9e7de42

Browse files
fix: update RSS feed item links to include base path for correct URL structure
1 parent 41c3ed0 commit 9e7de42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/rss.xml.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export async function GET(context) {
88

99
// Get the absolute site URL from the context (configured in astro.config.mjs)
1010
const siteUrl = context.site;
11+
const basePath = '/cookbook/'; // Your configured base
1112

1213
// Process each post to create an RSS feed item.
1314
const items = await Promise.all(posts.map(async (post) => {
@@ -23,7 +24,7 @@ export async function GET(context) {
2324
return {
2425
title: post.data.title,
2526
// Construct the link using your collection's URL structure
26-
link: `/blog/${post.slug}/`,
27+
link: new URL(`blog/${post.slug}/`, siteUrl + basePath).href,
2728
pubDate: post.data.pubDate,
2829
// Use a short summary as description; if you want to include the full content, set it in content
2930
description: post.data.description,

0 commit comments

Comments
 (0)