diff options
author | 2022-01-03 13:59:34 -0600 | |
---|---|---|
committer | 2022-01-03 11:59:34 -0800 | |
commit | f26eb7b74558a06ed96e7c94fd9844eaf2508fb4 (patch) | |
tree | 750ea3ba771df1669aa50782b7882ed6bee0132b /docs/src/components/Header/LanguageSelect.tsx | |
parent | f9b813aa86a199c8c00a4e1fe306ff6db24f1b31 (diff) | |
download | astro-f26eb7b74558a06ed96e7c94fd9844eaf2508fb4.tar.gz astro-f26eb7b74558a06ed96e7c94fd9844eaf2508fb4.tar.zst astro-f26eb7b74558a06ed96e7c94fd9844eaf2508fb4.zip |
Docs/move-english-docs-to-"en"-folder (#2268)
* Move english pages under `/en` and fix broken links hopefully
* Add meta refresh tags for `/` to `/en/` url moves + make `/index.astro` work without js
* update languageselect for new en format
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Diffstat (limited to 'docs/src/components/Header/LanguageSelect.tsx')
-rw-r--r-- | docs/src/components/Header/LanguageSelect.tsx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/docs/src/components/Header/LanguageSelect.tsx b/docs/src/components/Header/LanguageSelect.tsx index 37fef6d08..70fb405a4 100644 --- a/docs/src/components/Header/LanguageSelect.tsx +++ b/docs/src/components/Header/LanguageSelect.tsx @@ -29,11 +29,7 @@ const LanguageSelect: FunctionalComponent<{ lang: string }> = ({ lang }) => { aria-label="Select language" onChange={(e) => { const newLang = e.target.value; - if (newLang === 'en') { - window.location.pathname = `/getting-started`; - } else { - window.location.pathname = `/${newLang}/getting-started`; - } + window.location.pathname = `/${newLang}/getting-started`; // TODO: Preserve the current page, if it exists: // const oldPathname = window.location.pathname; // const oldPathnameParts = oldPathname.split('/'); |