Last active
April 7, 2019 17:50
-
-
Save klaasnotfound/22efc8afd773588acc65996b343ce602 to your computer and use it in GitHub Desktop.
A minimal example for a base.html file that can be used with the modified Jekyll i18n plugin and performs a browser language-based redirect.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Simple Redirect Page</title> | |
</head> | |
<body> | |
<script> | |
var lang = navigator.language || navigator.userLanguage; | |
if (lang.indexOf('de') == 0) | |
window.location = '/de/'; | |
// Other languages here | |
else | |
// Default to English | |
window.location = '/en/'; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment