From 942b7e2077e1673afebf626fcc33a2186e46444b Mon Sep 17 00:00:00 2001 From: Valentin Date: Thu, 13 Nov 2025 00:08:38 +0100 Subject: =?UTF-8?q?Seite=20f=C3=BCr=20Termine,=20die=20in=20der=20Vergange?= =?UTF-8?q?nheit=20liegen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dieser Aufbau unterstützt Umleitungen, sodass alte Links gültig bleiben. --- www/html/redirects.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 www/html/redirects.js (limited to 'www/html/redirects.js') diff --git a/www/html/redirects.js b/www/html/redirects.js new file mode 100644 index 0000000..789dedb --- /dev/null +++ b/www/html/redirects.js @@ -0,0 +1,18 @@ +const redirects = { +}; + +let segments = document.location.pathname.split('/'); +// Das erste Element ist immer `''` +segments.splice(0, 1); +let file = segments.pop(); +if (file === '') { file = "index.html"; } +segments.push(file); +const path = segments.join('/'); +const anchor = document.location.hash.substring(1); +const redirect = redirects[path]; +if (redirect) { + const target = redirect[anchor]; + if (target) { + document.location.href = target; + } +} -- cgit v1.2.3