[docs] Add anchors for configs on the configuration page

This commit is contained in:
DarthSim
2023-08-15 17:55:01 +03:00
parent e976424c1e
commit e172b14377

View File

@@ -26,6 +26,8 @@ const proLink = `<a class="badge" href="https://imgproxy.net/#pro" target="_blan
const oldProBadge = "<i class='badge badge-pro'></i>";
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, '* <code id="$1">$1</code>:');
next(content);
})