mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-08-24 02:57:43 +02:00
Changed website manual navigation
This commit is contained in:
+10
-8
@@ -97,15 +97,17 @@ function rewriteManualLinks(content, lang) {
|
|||||||
return `[${label}](/manual/${linkLang}/${slug.toLowerCase()}/)`;
|
return `[${label}](/manual/${linkLang}/${slug.toLowerCase()}/)`;
|
||||||
})
|
})
|
||||||
|
|
||||||
// Markdown-Links auf de-/en-Dateien ohne .md
|
// Markdown links to German or English manual pages.
|
||||||
.replace(/\]\((en|de)-([^)#]+)\)/g, (match, linkLang, slug) => {
|
// The source may contain an optional ".md" suffix and an optional anchor.
|
||||||
return `](/manual/${linkLang}/${slug.toLowerCase()}/)`;
|
// 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
|
return `](/manual/${linkLang}/${slug.toLowerCase()}/${fragment})`;
|
||||||
.replace(/\]\((en|de)-([^)#]+)\.md\)/g, (match, linkLang, slug) => {
|
}
|
||||||
return `](/manual/${linkLang}/${slug.toLowerCase()}/)`;
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = function (eleventyConfig) {
|
module.exports = function (eleventyConfig) {
|
||||||
|
|||||||
Reference in New Issue
Block a user