fix: Add /en/learn and redirect to /zh/learn

Signed-off-by: lannyfu <lannyfu@kubesphere.io>
This commit is contained in:
lannyfu 2023-10-19 08:54:22 +08:00
parent f5252efe8c
commit fd182f3727
3 changed files with 15 additions and 23 deletions

View File

@ -0,0 +1,4 @@
---
title: 云原生实战
css: "scss/learn.scss"
---

View File

@ -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)
}
</script>
{{ end }}

View File

@ -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