From 06a50db9876e6452ffc2ac2da0d7140c549d4084 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Mon, 16 Nov 2026 13:35:16 +0000 Subject: [PATCH] fix: add feed GUIDs and match production URL format - Add elements to RSS feed (matching URLs) - Preserve dots in slugs (t.i.l. instead of til) to match production - URLs now match production format: /YYYY-MM-DD-title-slug/ No /posts/ prefix, with dots preserved for T.I.L. posts - This ensures feed readers won't mark posts as new --- app.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 00854c8..45967c7 100644 --- a/app.js +++ b/app.js @@ -164,9 +164,11 @@ function feedPlugin() { }); posts.forEach((post) => { + const postUrl = `https://marcusnoble.co.uk/${post.path}/`; feed.item({ title: post.title, - url: `https://marcusnoble.co.uk/${post.path}/`, + url: postUrl, + guid: postUrl, date: post.date.toISOString(), description: post.summary || "", categories: (post.tags || "").split(" ").filter(Boolean), @@ -436,15 +438,14 @@ const ms = Metalsmith(__dirname) const d = value; return d.getFullYear() + "-" + String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0"); } - return String(value).toLowerCase().replace(/\s+/g, "-").replace(slugRe, "").replace(/-+/g, "-").replace(/\./g, ""); + return String(value).toLowerCase().replace(/\s+/g, "-").replace(slugRe, "").replace(/-+/g, "-"); }) .replace(/\/+$/, ""); - // Add directory index - if (path.extname(result) === "" || path.extname(result) === ".html") { - if (!path.extname(result)) { - result = path.join(result, "index.html"); - } + // Add directory index - force index.html for permalinks without .html extension + // Dots in titles (like T.I.L.) confuse path.extname() so we check the actual extension + if (!result.endsWith(".html")) { + result = path.join(result, "index.html"); } // Post files: no prefix - URLs match production format /YYYY-MM-DD-slug/