Skip to content

Commit

Permalink
disable indexing of all versions except the current master
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Sep 2, 2024
1 parent 7ee6c2e commit edabe44
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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} */
Expand Down

0 comments on commit edabe44

Please sign in to comment.