From 25186c75b97ec07f497aa02f29863e1872fb9252 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 16 Nov 2026 15:29:02 +0000 Subject: [PATCH] fix: RSS feed description contains only article content, not full page Extract just the
element (title + body) for feed descriptions, removing header, navigation, share buttons, and footer. --- app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 334a92b..b2d0e1e 100644 --- a/app.js +++ b/app.js @@ -172,9 +172,10 @@ function feedPlugin() { let renderedContent = ""; if (files[contentKey]) { const fullHtml = files[contentKey].contents.toString(); - // Extract body content (match what metalsmith-feed did) - const bodyMatch = fullHtml.match(/]*>([\s\S]*)<\/body>/i); - renderedContent = bodyMatch ? bodyMatch[1].trim() : fullHtml; + // Extract just the post content (not header/footer/navigation) + // Match the article element which contains the actual post content + const articleMatch = fullHtml.match(/]*>([\s\S]*?)<\/article>/i); + renderedContent = articleMatch ? articleMatch[1].trim() : fullHtml; } feed.item({