From 52e6c037309a752741f79264afb3e83cd75feabc Mon Sep 17 00:00:00 2001
From: ikorihn <16367098+ikorihn@users.noreply.github.com>
Date: Sun, 14 Jan 2024 02:08:21 +0900
Subject: [PATCH] fix: broken RSS item's link, which were set to
`https:/${base}`. (#687)
---
quartz/plugins/emitters/contentIndex.ts | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.ts
index bc4c6c325..47a84270a 100644
--- a/quartz/plugins/emitters/contentIndex.ts
+++ b/quartz/plugins/emitters/contentIndex.ts
@@ -48,12 +48,11 @@ function generateSiteMap(cfg: GlobalConfiguration, idx: ContentIndex): string {
function generateRSSFeed(cfg: GlobalConfiguration, idx: ContentIndex, limit?: number): string {
const base = cfg.baseUrl ?? ""
- const root = `https://${base}`
const createURLEntry = (slug: SimpleSlug, content: ContentDetails): string => `-
${escapeHTML(content.title)}
- ${joinSegments(root, encodeURI(slug))}
- ${joinSegments(root, encodeURI(slug))}
+ https://${joinSegments(base, encodeURI(slug))}
+ https://${joinSegments(base, encodeURI(slug))}
${content.richContent ?? content.description}
${content.date?.toUTCString()}
`
@@ -78,7 +77,7 @@ function generateRSSFeed(cfg: GlobalConfiguration, idx: ContentIndex, limit?: nu
${escapeHTML(cfg.pageTitle)}
- ${root}
+ https://${base}
${!!limit ? `Last ${limit} notes` : "Recent notes"} on ${escapeHTML(
cfg.pageTitle,
)}