From edabe449da450e868eaec2114ba276c31d2a0d8f Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 2 Sep 2024 18:15:46 +0200 Subject: [PATCH] disable indexing of all versions except the current master --- docs/website/docusaurus.config.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/website/docusaurus.config.js b/docs/website/docusaurus.config.js index 49deea718b..1b166c2317 100644 --- a/docs/website/docusaurus.config.js +++ b/docs/website/docusaurus.config.js @@ -10,7 +10,8 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); // create versions config const versions = {"current": { label: 'devel', - path: 'devel' + path: 'devel', + noIndex: true }} // inject master version renaming only if versions present @@ -19,6 +20,16 @@ if (fs.existsSync("versions.json")) { label: process.env.DOCUSAURUS_DLT_VERSION || "latest", path: '/' } + // disable indexing for all known versions + for (let v of JSON.parse(fs.readFileSync("versions.json"))) { + if (v == "master") { + continue; + } + versions[v] = { + noIndex: true + } + } + } /** @type {import('@docusaurus/types').Config} */