mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 20:25:32 -04:00
* concat location properties and use URL constructor to fix issues * remove slashes from old version urls * remove versions 1.125.0 and 1.125.4 that don't have docs archives
This commit is contained in:
parent
6c64a6dab8
commit
16266c9f5a
@ -24,10 +24,13 @@ export default function VersionSwitcher(): JSX.Element {
|
|||||||
{ label: 'Next', url: 'https://main.preview.immich.app' },
|
{ label: 'Next', url: 'https://main.preview.immich.app' },
|
||||||
{ label: 'Latest', url: 'https://immich.app' },
|
{ label: 'Latest', url: 'https://immich.app' },
|
||||||
...archiveVersions,
|
...archiveVersions,
|
||||||
];
|
].map(({ label, url }) => ({
|
||||||
|
label,
|
||||||
|
url: new URL(url),
|
||||||
|
}));
|
||||||
setVersions(allVersions);
|
setVersions(allVersions);
|
||||||
|
|
||||||
const activeVersion = allVersions.find((version) => new URL(version.url).origin === window.location.origin);
|
const activeVersion = allVersions.find((version) => version.url.origin === window.location.origin);
|
||||||
if (activeVersion) {
|
if (activeVersion) {
|
||||||
setLabel(activeVersion.label);
|
setLabel(activeVersion.label);
|
||||||
}
|
}
|
||||||
@ -49,7 +52,7 @@ export default function VersionSwitcher(): JSX.Element {
|
|||||||
mobile={windowSize === 'mobile'}
|
mobile={windowSize === 'mobile'}
|
||||||
items={versions.map(({ label, url }) => ({
|
items={versions.map(({ label, url }) => ({
|
||||||
label,
|
label,
|
||||||
to: url + location.pathname + location.hash,
|
to: new URL(location.pathname + location.search + location.hash, url).href,
|
||||||
target: '_self',
|
target: '_self',
|
||||||
}))}
|
}))}
|
||||||
/>
|
/>
|
||||||
|
30
docs/static/archived-versions.json
vendored
30
docs/static/archived-versions.json
vendored
@ -19,10 +19,6 @@
|
|||||||
"label": "v1.125.5",
|
"label": "v1.125.5",
|
||||||
"url": "https://v1.125.5.archive.immich.app"
|
"url": "https://v1.125.5.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"label": "v1.125.4",
|
|
||||||
"url": "https://v1.125.4.archive.immich.app"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"label": "v1.125.3",
|
"label": "v1.125.3",
|
||||||
"url": "https://v1.125.3.archive.immich.app"
|
"url": "https://v1.125.3.archive.immich.app"
|
||||||
@ -35,10 +31,6 @@
|
|||||||
"label": "v1.125.1",
|
"label": "v1.125.1",
|
||||||
"url": "https://v1.125.1.archive.immich.app"
|
"url": "https://v1.125.1.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"label": "v1.125.0",
|
|
||||||
"url": "https://v1.125.0.archive.immich.app"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"label": "v1.124.2",
|
"label": "v1.124.2",
|
||||||
"url": "https://v1.124.2.archive.immich.app"
|
"url": "https://v1.124.2.archive.immich.app"
|
||||||
@ -201,46 +193,46 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.105.1",
|
"label": "v1.105.1",
|
||||||
"url": "https://v1.105.1.archive.immich.app/"
|
"url": "https://v1.105.1.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.105.0",
|
"label": "v1.105.0",
|
||||||
"url": "https://v1.105.0.archive.immich.app/"
|
"url": "https://v1.105.0.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.104.0",
|
"label": "v1.104.0",
|
||||||
"url": "https://v1.104.0.archive.immich.app/"
|
"url": "https://v1.104.0.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.103.1",
|
"label": "v1.103.1",
|
||||||
"url": "https://v1.103.1.archive.immich.app/"
|
"url": "https://v1.103.1.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.103.0",
|
"label": "v1.103.0",
|
||||||
"url": "https://v1.103.0.archive.immich.app/"
|
"url": "https://v1.103.0.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.102.3",
|
"label": "v1.102.3",
|
||||||
"url": "https://v1.102.3.archive.immich.app/"
|
"url": "https://v1.102.3.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.102.2",
|
"label": "v1.102.2",
|
||||||
"url": "https://v1.102.2.archive.immich.app/"
|
"url": "https://v1.102.2.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.102.1",
|
"label": "v1.102.1",
|
||||||
"url": "https://v1.102.1.archive.immich.app/"
|
"url": "https://v1.102.1.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.102.0",
|
"label": "v1.102.0",
|
||||||
"url": "https://v1.102.0.archive.immich.app/"
|
"url": "https://v1.102.0.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.101.0",
|
"label": "v1.101.0",
|
||||||
"url": "https://v1.101.0.archive.immich.app/"
|
"url": "https://v1.101.0.archive.immich.app"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "v1.100.0",
|
"label": "v1.100.0",
|
||||||
"url": "https://v1.100.0.archive.immich.app/"
|
"url": "https://v1.100.0.archive.immich.app"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user