From c682ecf3f9f5120000c40f59fe2df06bd6115515 Mon Sep 17 00:00:00 2001 From: Marc Froehlich Date: Thu, 6 Aug 2026 00:46:00 +0200 Subject: [PATCH] Changed website manual navigation --- website/.eleventy.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/website/.eleventy.js b/website/.eleventy.js index 40edea4..74597cb 100644 --- a/website/.eleventy.js +++ b/website/.eleventy.js @@ -97,15 +97,17 @@ function rewriteManualLinks(content, lang) { return `[${label}](/manual/${linkLang}/${slug.toLowerCase()}/)`; }) - // Markdown-Links auf de-/en-Dateien ohne .md - .replace(/\]\((en|de)-([^)#]+)\)/g, (match, linkLang, slug) => { - return `](/manual/${linkLang}/${slug.toLowerCase()}/)`; - }) + // Markdown links to German or English manual pages. + // The source may contain an optional ".md" suffix and an optional anchor. + // Both forms must be converted to the corresponding website manual URL. + .replace( + /\]\((en|de)-([^#)]+?)(?:\.md)?(?:#([^)]+))?\)/g, + (match, linkLang, slug, anchor) => { + const fragment = anchor ? `#${anchor}` : ""; - // Markdown-Links auf de-/en-Dateien mit .md - .replace(/\]\((en|de)-([^)#]+)\.md\)/g, (match, linkLang, slug) => { - return `](/manual/${linkLang}/${slug.toLowerCase()}/)`; - }); + return `](/manual/${linkLang}/${slug.toLowerCase()}/${fragment})`; + } + ); } module.exports = function (eleventyConfig) {