Skip to content

Commit

Permalink
Ensure pre-releases are not the latest docs version
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Jun 15, 2023
1 parent 01646f5 commit dd9cdcc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ const ArchivedVersionsDropdownItems = Object.entries(VersionsArchived).splice(
5,
);

function getLastVersion() {
const isPrerelease = (version) =>
version.includes('alpha') ||
version.includes('beta') ||
version.includes('rc');
const firstStableVersion = versions.find((version) => !isPrerelease(version));
return firstStableVersion ?? versions[0];
}

// This probably only makes sense for the alpha/beta/rc phase, temporary
function getNextVersionName() {
return 'Canary';
Expand Down Expand Up @@ -362,7 +371,7 @@ module.exports = async function createConfigAsync() {
lastVersion:
isDev || isDeployPreview || isBranchDeploy
? 'current'
: undefined,
: getLastVersion(),

onlyIncludeVersions: (() => {
if (isBuildFast) {
Expand Down

0 comments on commit dd9cdcc

Please sign in to comment.