File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,27 @@ const vitePressConfig: UserConfig = {
1818 "script" ,
1919 { } ,
2020 `
21- (function() {
22- const { pathname, search, hash } = window.location;
23- const base = '/';
24- if (pathname === base || pathname === (base + 'index.html')) {
25- const userLang = navigator.language;
26- if (userLang.toLowerCase().startsWith('zh')) {
27- window.location.replace(base + 'zhHans/' + search + hash);
28- }
21+ (function() {
22+ const { pathname, search, hash } = window.location;
23+ const base = '/';
24+
25+ const prefixes = ['/tessera-official-website', '/tessera-offcial-website'];
26+ for (const prefix of prefixes) {
27+ if (pathname.startsWith(prefix)) {
28+ const newPath = pathname.slice(prefix.length) || '/';
29+ window.location.replace(newPath + search + hash);
30+ return;
31+ }
32+ }
33+
34+ if (pathname === base || pathname === (base + 'index.html')) {
35+ const userLang = navigator.language;
36+ if (userLang.toLowerCase().startsWith('zh')) {
37+ window.location.replace(base + 'zhHans/' + search + hash);
2938 }
30- })();
31- ` ,
39+ }
40+ })();
41+ ` ,
3242 ] ,
3343 ] ,
3444
You can’t perform that action at this time.
0 commit comments