chore: fix 404 page

This commit is contained in:
Matthias
2024-08-20 20:46:58 +02:00
parent ac846c52a5
commit 88597f5081

View File

@@ -2,7 +2,7 @@
// Check if the current path is versioned, if not, redirect to the default versioned path // Check if the current path is versioned, if not, redirect to the default versioned path
const versions = ["0.19.x", "latest"] const versions = ["0.19.x", "latest"]
const defaultVersion = "latest" const defaultVersion = "latest"
const basePath = "/gitlint" const basePath = "/freqtrade/en"
const targetRedirectPath = "404" // path to redirect to, relative to basePath const targetRedirectPath = "404" // path to redirect to, relative to basePath
// if path starts with version, redirect to versioned 404 // if path starts with version, redirect to versioned 404
@@ -21,6 +21,6 @@
// Replace it in href, so we keep hashes and query params // Replace it in href, so we keep hashes and query params
// Only replace first occurence of basePath // Only replace first occurence of basePath
if (!foundVersion){ if (!foundVersion){
window.location.href = window.location.href.replace(basePath, `${basePath}/en/${defaultVersion}`) window.location.href = window.location.href.replace(basePath, `${basePath}/${defaultVersion}`)
} }
</script> </script>