diff --git a/web/app/rss.xml/route.ts b/web/app/rss.xml/route.ts index 4a1fa75..1186c7e 100644 --- a/web/app/rss.xml/route.ts +++ b/web/app/rss.xml/route.ts @@ -13,6 +13,21 @@ interface ChangelogEntry { function formatContentForRSS(content: string): string { return ( content + .replace(/!\[([^\]]*)\]$$([^)]+)$$/g, (match, alt, url) => { + // Convert relative URLs to absolute + let absoluteUrl = url + if (url.startsWith("/")) { + absoluteUrl = `https://proxmenux.com${url}` + } else if (url.startsWith("http://") || url.startsWith("https://")) { + // Already absolute, but replace old GitHub URLs with new domain + absoluteUrl = url.replace("https://macrimi.github.io/ProxMenux", "https://proxmenux.com") + } else { + // Relative path, make it absolute + absoluteUrl = `https://proxmenux.com/${url}` + } + return `${alt}` + }) + .replace(/\[([^\]]+)\]$$([^)]+)$$/g, '$1') // Convert ### headers to

tags .replace(/^### (.+)$/gm, "

$1

") // Convert ** bold ** to tags @@ -22,12 +37,12 @@ function formatContentForRSS(content: string): string { const code = match.replace(/```/g, "").trim() return `
${code}
` }) + .replace(/`([^`]+)`/g, "$1") // Convert - bullet points to