add auto locale config

This commit is contained in:
Masterain
2023-03-20 20:30:27 -07:00
parent 3c5a66134a
commit d067479959
2 changed files with 9 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ import theme from "./theme.js";
import { autoCatalogPlugin } from "vuepress-plugin-auto-catalog";
import { docsearchPlugin } from '@vuepress/plugin-docsearch'
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
import { redirectPlugin } from "vuepress-plugin-redirect";
export default defineUserConfig({
base: "/",
@@ -55,7 +56,14 @@ export default defineUserConfig({
}),
googleAnalyticsPlugin({
id: "G-F3LFJCE3RM"
})
}),
redirectPlugin({
autoLocale: true,
localeConfig: {
"/en/": ["en-US", "en-UK", "en"],
"/zh/": ["zh-CN", "zh-TW", "zh"],
},
}),
],
theme,

View File

@@ -1,19 +0,0 @@
---
home: true
icon: home
title: Language Selection
heroImage: https://img.alicdn.com/imgextra/i4/1797064093/O1CN01vK3m2w1g6duwt8quS_!!1797064093.png
heroText: Snap Hutao
tagline: Select Your Language
actions:
- text: zh-CN
link: /zh/
type: primary
- text: en-US
link: /en/
type: primary
copyright: false
footer: MIT Licensed | Copyright © 2019-present Mr.Hope
---