diff --git a/content/en/learn/_index.md b/content/en/learn/_index.md new file mode 100644 index 000000000..00fdd0544 --- /dev/null +++ b/content/en/learn/_index.md @@ -0,0 +1,4 @@ +--- +title: 云原生实战 +css: "scss/learn.scss" +--- diff --git a/layouts/learn/list.html b/layouts/learn/list.html index c052cf4fe..6f39837b9 100644 --- a/layouts/learn/list.html +++ b/layouts/learn/list.html @@ -302,5 +302,16 @@ var swiperPlay = function(){ swiperPlay(); window.addEventListener('resize', debounce(swiperPlay, 500)); + +var handleLangChange = function (lang, href) { + try { + localStorage.setItem('lang', lang) + } catch (err) { } + location.href = href +} + +if ('{{ .Language }}' === 'en') { + handleLangChange('zh', window.location.pathname) +} {{ end }} \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 0523760e6..cf6fb80ce 100644 --- a/netlify.toml +++ b/netlify.toml @@ -28,26 +28,3 @@ status = 301 force = true -[[redirects]] - from = "/learn/" - to = "/zh/learn/" - status = 301 - force = true - -[[redirects]] - from = "/learn/*" - to = "/zh/learn/*" - status = 301 - force = true - -[[redirects]] - from = "/live/" - to = "/zh/live/" - status = 301 - force = true - -[[redirects]] - from = "/live/*" - to = "/zh/live/*" - status = 301 - force = true