From 338bd3cc64b7225ab352a0240d78169a914cd92c Mon Sep 17 00:00:00 2001 From: Ricardo Date: Tue, 24 Feb 2026 20:53:04 +0100 Subject: [PATCH] fix: correct alternate link URL for markdown-agents Add stripTrailingSlash filter and use it in the link tag so the alternate URL is /articles/.../slug.md (matching nginx routing) instead of /articles/.../slug/index.md. --- eleventy.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eleventy.config.js b/eleventy.config.js index 7108c90..b3b6d3f 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -412,6 +412,11 @@ export default function (eleventyConfig) { .replace(/^-+|-+$/g, ""); }); + eleventyConfig.addFilter("stripTrailingSlash", (url) => { + if (!url || typeof url !== "string") return url || ""; + return url.endsWith("/") ? url.slice(0, -1) : url; + }); + // Hash filter for cache busting - generates MD5 hash of file content eleventyConfig.addFilter("hash", (filePath) => { try {