chore(docs): don't auto-bump lastVersion when cutting a new version

Superset's docs site keeps `lastVersion: 'current'` in every section so
the canonical URLs (`/docs/...`, `/admin-docs/...`, etc.) always render
master content, with cut versions accessible only via their explicit
version segment. The script's previous "auto-bump on first cut"
behavior was a generic Docusaurus default that doesn't match this
intent — for a section's first cut it would silently set lastVersion
to the new version, redirecting the canonical URL to the historical
snapshot.

Drop the auto-bump. Operators who want the new version to become the
canonical URL can edit versions-config.json after cutting.
This commit is contained in:
Claude Code
2026-05-12 17:16:04 -07:00
parent b4a0439756
commit 8386c3a042

View File

@@ -269,10 +269,12 @@ function addVersion(section, version) {
banner: 'none'
};
// Optionally update lastVersion if this is the first non-current version
if (config[section].onlyIncludeVersions.length === 2) {
config[section].lastVersion = version;
}
// Note: we deliberately do NOT auto-bump `lastVersion` to the new
// version. Superset's docs site keeps `lastVersion: 'current'` so the
// canonical URLs (`/docs/...`, `/admin-docs/...`, etc.) always render
// master content; cut versions are accessed only via their explicit
// version segment. If you want a different policy, edit
// versions-config.json after cutting.
saveConfig(config);
console.log(`✅ Version ${version} added successfully to ${section}`);