Full post content in RSS

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
AverageMarcus committed 2026-11-16 17:11:30 +00:00
1 parent c69e2cbb97
commit 22789160fd
1 file changed
+10 -1
+10 -1
View File
@@ -165,12 +165,21 @@ function feedPlugin() {
posts.forEach((post) => {
const postUrl = `https://marcusnoble.co.uk/${post.path}/`;
const contentKey = post.path + '/index.html';
let renderedContent = "";
if (files[contentKey]) {
const fullHtml = files[contentKey].contents.toString();
const articleMatch = fullHtml.match(/<div class="post-body"[^>]*>([\s\S]*?)<\/div/i);
renderedContent = articleMatch ? articleMatch[1].trim() : fullHtml;
}
feed.item({
title: post.title,
url: postUrl,
guid: postUrl,
date: post.date.toISOString(),
description: post.summary || "",
description: renderedContent || post.summary || "",
categories: (post.tags || "").split(" ").filter(Boolean),
});
});