From e172b14377c766ffacf1bdec62294e737150c4b1 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Tue, 15 Aug 2023 17:55:01 +0300 Subject: [PATCH] [docs] Add anchors for configs on the configuration page --- docs/assets/docsify-init.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/assets/docsify-init.js b/docs/assets/docsify-init.js index 3b01c4e4..573d8b59 100644 --- a/docs/assets/docsify-init.js +++ b/docs/assets/docsify-init.js @@ -26,6 +26,8 @@ const proLink = `"; +const configRegex = /^\* `([^`]+)`:/gm; + const defaultVersions = [["latest", "latest"]]; const configureDocsify = (additionalVersions, latestVersion, latestTag) => { @@ -124,6 +126,10 @@ const configureDocsify = (additionalVersions, latestVersion, latestTag) => { hook.beforeEach((content, next) => { content = content.replaceAll(proBadgeRegex, proLink); content = content.replaceAll(oldProBadge, proLink); + + if (vm.route.path.endsWith('/configuration')) + content = content.replaceAll(configRegex, '* $1:'); + next(content); })