This commit is contained in:
恍兮惚兮 2024-07-19 00:56:56 +08:00
parent eddc025ee1
commit d996a8a467
2 changed files with 19 additions and 10 deletions

View File

@ -1,6 +1,6 @@
window.$docsify = {
homepage: '/redirect.html',
// homepage: '/redirect.html',
requestHeaders: {
'cache-control': 'max-age=0',
},
@ -79,18 +79,28 @@ const navitexts = {
contactme: 'Chat Groups'
}
}
function getcurrlang(url) {
for (let key in navitexts) {
if (url.includes(`/${key}/`)) {
return key
}
}
return ''
}
window.onpopstate = function (event) {
let url = window.location.href;
let thislang = currentlang
if (url.includes('/zh/')) {
thislang = 'zh'
console.log(url)
if (url.endsWith('/#/')) {
window.location.href += 'zh/'
return
}
else if (url.includes('/en/')) {
thislang = 'en'
}
else if (url.includes('/ru/')) {
thislang = 'ru'
for (let key in navitexts) {
if (url.endsWith(`/${key}/`)) {
window.location.href += 'README'
return
}
}
let thislang = getcurrlang(url)
if (thislang != currentlang) {
currentlang = thislang
console.log(navitexts[currentlang])

View File

@ -1 +0,0 @@
<meta http-equiv="refresh" content="0; URL=/#/zh/">