redirect all RTD pages

This commit is contained in:
Michael Shamoon
2022-11-29 22:29:55 -08:00
parent 3e22e8e0b9
commit 304cfc42a9
16 changed files with 107 additions and 6901 deletions

View File

@@ -8,6 +8,31 @@
document.documentElement.classList.toggle("dark-mode", darkModeState);
document.documentElement.classList.toggle("light-mode", !darkModeState);
const RTD_TO_MKD = {
"index.html": "",
"setup.html": "setup",
"usage_overview.html": "usage",
"advanced_usage.html": "advanced_usage",
"administration.html": "administration",
"configuration.html": "configuration",
"api.html": "api",
"faq.html": "faq",
"troubleshooting.html": "troubleshooting",
"extending.html": "development",
"scanners.html": "",
"screenshots.html": "",
"changelog.html": "changelog",
}
const path = RTD_TO_MKD[window.location.pathname.substring(window.location.pathname.lastIndexOf("/") + 1)] + "/";
const hash = window.location.hash;
const redirectURL = new URL(path + hash, "https://paperless-ngx.com/");
console.log(`Redirecting to ${redirectURL} in 3 seconds...`);
setTimeout(() => {
window.location.replace(redirectURL);
}, 3000);
</script>
{{ super() }}
{% endblock %}