feat(documentation): change docs to use LTS/STS instead of version number ()

release/2.27.0-rc1
James Player 2025-02-03 11:17:36 +13:00 committed by GitHub
parent 17a4750d8e
commit e943aa8f03
1 changed files with 3 additions and 10 deletions
app/react/components/PageHeader

View File

@ -40,17 +40,10 @@ export function useDocsUrl(doc?: string): string {
}
let url = 'https://docs.portainer.io/';
if (versionQuery.data) {
let { ServerVersion } = versionQuery.data;
if (ServerVersion[0] === 'v') {
ServerVersion = ServerVersion.substring(1);
}
const parts = ServerVersion.split('.');
if (parts.length >= 2) {
const version = parts.slice(0, 2).join('.');
url += `v/${version}`;
}
// Add LTS or STS version if we have it
if (versionQuery.data?.VersionSupport) {
url += versionQuery.data.VersionSupport.toLowerCase();
}
if (doc) {