This commit is contained in:
parent
c33d245221
commit
18f5c29b22
1 changed files with 13 additions and 0 deletions
|
@ -35,6 +35,19 @@
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
<!-- Localization Auto Redirect -->
|
||||||
|
{{ if .IsHome }}
|
||||||
|
<script>
|
||||||
|
const lang = navigator.language;
|
||||||
|
const path = window.location.pathname;
|
||||||
|
|
||||||
|
if (lang.startsWith('de') && path !== "/") {
|
||||||
|
window.location.href = "/";
|
||||||
|
} else if (!lang.startsWith('de') && path !== "/en/") {
|
||||||
|
window.location.href = "/en/";
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{{ end }}
|
||||||
<!-- Exo 2 Font -->
|
<!-- Exo 2 Font -->
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600&display=swap" rel="stylesheet"/>
|
<link href="https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600&display=swap" rel="stylesheet"/>
|
||||||
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue