fix: Link to latest docs in pre-release openapi output

Resolves #2018
This commit is contained in:
Wolfgang Walther
2021-11-29 08:40:38 +01:00
committed by Wolfgang Walther
parent 9c6597c351
commit bbc07d3f40
+4 -2
View File
@@ -30,10 +30,12 @@ prettyVersion =
-- | Version number used in docs.
-- Pre-release versions link to the latest docs
-- Uses only the two first components of the version. Example: 'v1.1'
docsVersion :: Text
docsVersion =
"v" <> (T.intercalate "." . map show . take 2 $ versionBranch version)
docsVersion
| isPreRelease = "latest"
| otherwise = "v" <> (T.intercalate "." . map show . take 2 $ versionBranch version)
-- | Versions with four components (e.g., '1.1.1.1') are treated as pre-releases.