From d41d02404c152d6ab189b3825c47fc852b976670 Mon Sep 17 00:00:00 2001 From: Pomax Date: Wed, 5 Aug 2020 21:57:16 -0700 Subject: [PATCH] base url resolution --- index.html | 12 +++++++++--- index.template.html | 7 +++++-- ja-JP/index.html | 14 ++++++++++---- tools/build/generate-lang-switcher.js | 14 +++----------- zh-CN/index.html | 14 ++++++++++---- 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/index.html b/index.html index 8432e508..e0a24d78 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,12 @@ A Primer on Bézier Curves + + + - + @@ -66,8 +72,8 @@ Read this in your own language: Don't see your language listed? diff --git a/index.template.html b/index.template.html index c470ee51..066147f6 100644 --- a/index.template.html +++ b/index.template.html @@ -10,6 +10,9 @@ {{ base }} + + + @@ -25,13 +28,13 @@ - + - + diff --git a/ja-JP/index.html b/ja-JP/index.html index 7bb0b8dc..9b17ac76 100644 --- a/ja-JP/index.html +++ b/ja-JP/index.html @@ -9,6 +9,12 @@ + + + - + @@ -67,9 +73,9 @@ Read this in your own language: Don't see your language listed? diff --git a/tools/build/generate-lang-switcher.js b/tools/build/generate-lang-switcher.js index 9d72f7f1..4b3ad2ee 100644 --- a/tools/build/generate-lang-switcher.js +++ b/tools/build/generate-lang-switcher.js @@ -6,18 +6,10 @@ export default function generateLangSwitcher(currentLocale, allLocales) { return allLocales .map((locale) => { let link; - if (currentLocale === defaultLocale) { - if (locale === defaultLocale) { - link = `./index.html`; - } else { - link = `${locale}/index.html`; - } + if (locale === defaultLocale) { + link = `./index.html`; } else { - if (locale === defaultLocale) { - link = `../index.html`; - } else { - link = `../${locale}/index.html`; - } + link = `./${locale}/index.html`; } return `
  • ${localeStrings.localeName[locale]}
  • `; }) diff --git a/zh-CN/index.html b/zh-CN/index.html index c66c9c7e..418e2054 100644 --- a/zh-CN/index.html +++ b/zh-CN/index.html @@ -9,6 +9,12 @@ + + + - + @@ -67,9 +73,9 @@ Read this in your own language: Don't see your language listed?