landingpage/themes/app-landingpage/layouts/alias.html
Dorian Zedler 1b923de71a
Some checks failed
continuous-integration/drone Build is failing
Chore: initial commit
2022-08-06 20:25:26 +02:00

46 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>{{ .Permalink }}</title>
<link rel="canonical" href="{{ .Permalink }}"/>
<meta name="robots" content="noindex">
<meta charset="utf-8"/>
<noscript>
<meta http-equiv="refresh" content="0; url={{ .Permalink }}"/>
</noscript>
<script>
var lang = "en";
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
if (Object.keys(params).length > 0) {
sessionStorage.setItem('originalQuery', window.location.search);
}
if (
typeof navigator.languages !== "undefined" &&
navigator.languages.length > 0
) {
for (var i = 0; i < navigator.languages.length; ++i) {
var tag = navigator.languages[i].slice(0, 2).toLowerCase();
if (tag === "de" || tag === "en") {
lang = tag;
break;
}
}
} else if (
(navigator.language || navigator.userLanguage).slice(0, 2).toLowerCase() ===
"de"
) {
lang = "de";
}
window.location.href = "{{site.BaseURL}}/" + lang + "/";
</script>
</head>
<body>
<h1>Redirecting</h1>
<p>You should be redirected shortly, if not, <a href="{{ .Permalink }}">click here</a>.</p>
</body>
</html>