Skip to content

Commit a2cfc65

Browse files
committed
fix(config): add redirection from /zh/ to /zhHans/ in vitePress config
1 parent 62bb17b commit a2cfc65

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/.vitepress/config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ const vitePressConfig: UserConfig = {
3737
window.location.replace(base + 'zhHans/' + search + hash);
3838
}
3939
}
40+
41+
if (pathname.startsWith(base + 'zh/')) {
42+
// redirect /zh/ to /zhHans/
43+
const newPath = pathname.replace(base + 'zh/', base + 'zhHans/');
44+
window.location.replace(newPath + search + hash);
45+
return;
46+
}
4047
})();
4148
`,
4249
],

0 commit comments

Comments
 (0)