summaryrefslogtreecommitdiff
path: root/docs/src/pages/index.astro
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2021-07-30 22:39:15 -0700
committerGravatar GitHub <noreply@github.com> 2021-07-30 22:39:15 -0700
commit7c744961494ca80f82b3ad66c98ff0a1c0496db7 (patch)
tree6f0ed586edd85076b2660b3b00c0fbb91f470449 /docs/src/pages/index.astro
parentd0b8485ddfd8dca1376ea0d417ce37282d092cd9 (diff)
downloadastro-7c744961494ca80f82b3ad66c98ff0a1c0496db7.tar.gz
astro-7c744961494ca80f82b3ad66c98ff0a1c0496db7.tar.zst
astro-7c744961494ca80f82b3ad66c98ff0a1c0496db7.zip
Docs site cleanup (#948)
* add language selector * docs site cleanup * review feedback * code review comments
Diffstat (limited to 'docs/src/pages/index.astro')
-rw-r--r--docs/src/pages/index.astro21
1 files changed, 15 insertions, 6 deletions
diff --git a/docs/src/pages/index.astro b/docs/src/pages/index.astro
index 7b16ea1a0..b462cacf9 100644
--- a/docs/src/pages/index.astro
+++ b/docs/src/pages/index.astro
@@ -1,9 +1,18 @@
---
-import Layout from '../layouts/Main.astro';
+import Layout from '../layouts/MainLayout.astro';
---
-<Layout centered>
- <h1>
- <code style="white-space: nowrap;">npm init astro</code>
- </h1>
-</Layout>
+<script>
+ // This is some wip redirect code based on the browser language.
+ // A vercel.json redirect is enforced in production, so no user should ever see this page.
+ // Remove the vercel.json redirect when this is ready.
+ const KNOWN_LANGUAGES = ['en', 'nl'];
+ let newLang = (window.navigator.userLanguage || window.navigator.language || 'en').substr(0, 2);
+ if (newLang === 'en') {
+ window.location.pathname = '/getting-started';
+ } else if (KNOWN_LANGUAGES.includes(newLang)) {
+ window.location.pathname = '/' + newLang + '/getting-started';
+ } else {
+ window.location.pathname = '/getting-started';
+ }
+</script> \ No newline at end of file