Skip to content

Commit

Permalink
only use major versions
Browse files Browse the repository at this point in the history
add latest to version name
  • Loading branch information
sh-rp committed Sep 3, 2024
1 parent edabe44 commit 34d383f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion docs/website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ const versions = {"current": {

// inject master version renaming only if versions present
if (fs.existsSync("versions.json")) {
let latestLabel = "latest"
if (process.env.DOCUSAURUS_DLT_VERSION) {
latestLabel = `${process.env.DOCUSAURUS_DLT_VERSION} (latest)`
}


versions["master"] = {
label: process.env.DOCUSAURUS_DLT_VERSION || "latest",
label: latestLabel,
path: '/'
}
// disable indexing for all known versions
Expand Down
5 changes: 3 additions & 2 deletions docs/website/tools/update_versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ if (versions.length < 5) {
process.exit(1)
}

// go through the versions and find all newest versions of minor versions
// go through the versions and find all newest versions of any major version
const selectedVersions = ["master"];
let lastVersion = versions[0];
for (let ver of versions) {
if (semver.minor(ver) != semver.minor(lastVersion) || semver.major(ver) != semver.major(lastVersion)) {
if ( semver.major(ver) != semver.major(lastVersion)) {
selectedVersions.push(ver)
}
lastVersion = ver;
Expand All @@ -65,6 +65,7 @@ fs.mkdirSync(VERSIONED_SIDEBARS_FOLDER);
console.log("Checking branch")
const branch = proc.execSync(`cd ${REPO_DIR} && git rev-parse --abbrev-ref HEAD`).toString().trim()

// sanity check
if (branch != "devel") {
console.error("Could not check out devel branch")
process.exit(1)
Expand Down

0 comments on commit 34d383f

Please sign in to comment.