CI updated the documentation

This commit is contained in:
Continuous Integration
2025-03-10 21:27:38 +00:00
parent ca869387a4
commit d0dd617171
23 changed files with 2023 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { DOC_VERSIONS } from '../../versions.js';
const select = document.getElementById('plugin-versions-select');
DOC_VERSIONS.forEach((version) => {
const option = document.createElement('option');
option.value = version;
option.innerHTML = version;
select.appendChild(option);
});
const locationSplit = location.pathname.split('/');
const thisVersion = locationSplit.find((path) => ['stable', 'dev', ...DOC_VERSIONS].includes(path));
select.value = DOC_VERSIONS.includes(thisVersion)
? thisVersion
: DOC_VERSIONS[0];
select.onchange = () => {
const newPaths = window.location.pathname.replace(`/${thisVersion}/`, `/${select.value}/`);
const newUrl = new URL(newPaths, window.location.origin);
window.location.assign(newUrl);
};