feat(documentation): change docs to use LTS/STS instead of version number (#357)
parent
17a4750d8e
commit
e943aa8f03
app/react/components/PageHeader
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue