Skip to content

Commit

Permalink
detect mostRecentPreReleaseVersion in a way that actually works (#258)
Browse files Browse the repository at this point in the history
Followup to 6136389. The redirect for /stable and /dev worked, but not
/prerelease.

Test on fully built site:
```
$ curl http://localhost:3000/2.22/docs/introduction/welcome-to-pants
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="refresh" content="0; url=/prerelease/docs/introduction/welcome-to-pants">
    <link rel="canonical" href="/prerelease/docs/introduction/welcome-to-pants" />
  </head>
  <script>
    window.location.href = '/prerelease/docs/introduction/welcome-to-pants' + window.location.search + window.location.hash;
  </script>
```
  • Loading branch information
cburroughs authored Sep 5, 2024
1 parent 6136389 commit 58d59dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const getVersionDetails = () => {
const versionDetails = getVersionDetails();

const mostRecentPreReleaseVersion = versionDetails.find(
({ isMaintained }) => !isMaintained
(ver) => ver.isPrerelease && !ver.isCurrent
);

const mostRecentStableVersion = versionDetails.find(
Expand Down

0 comments on commit 58d59dd

Please sign in to comment.