docs: add i18n config

This commit is contained in:
pengzhanbo 2023-06-16 16:41:20 +08:00
parent 145f07c175
commit 30fe922a0c
5 changed files with 95 additions and 6 deletions

View File

@ -3,7 +3,7 @@ import { viteBundler } from '@vuepress/bundler-vite'
import { webpackBundler } from '@vuepress/bundler-webpack'
import { defineUserConfig } from '@vuepress/cli'
import themePlume from '@vuepress-plume/vuepress-theme-plume'
import notes from './notes.js'
import { enNotes, zhNotes } from './notes.js'
export default defineUserConfig({
base: '/',
@ -12,6 +12,18 @@ export default defineUserConfig({
description: '',
source: path.resolve(__dirname, '../'),
public: path.resolve(__dirname, 'public'),
locales: {
'/': {
title: 'Plume主题',
description: '',
lang: 'zh',
},
'/en/': {
title: 'Plume Theme',
description: '',
lang: 'en',
},
},
bundler:
process.env.DOCS_BUNDLER === 'webpack' ? webpackBundler() : viteBundler(),
@ -26,11 +38,11 @@ export default defineUserConfig({
description: 'The Theme for Vuepress 2.0',
},
social: [{ icon: 'github', link: 'https://github.com/pengzhanbo' }],
notes,
notes: zhNotes,
navbar: [
{ text: 'Home', link: '/', icon: 'material-symbols:home-outline' },
{ text: '首页', link: '/', icon: 'material-symbols:home-outline' },
{
text: 'Blog',
text: '博客',
link: '/blog/',
icon: 'material-symbols:article-outline',
},
@ -44,7 +56,7 @@ export default defineUserConfig({
icon: 'icon-park-outline:theme',
},
{
text: 'Plugin',
text: '插件',
icon: 'mingcute:plugin-2-line',
items: [
{
@ -74,5 +86,38 @@ export default defineUserConfig({
},
},
},
locales: {
'/': { selectLanguageName: '简体中文', selectLanguageText: '选择语言' },
'/en/': {
selectLanguageName: 'English',
selectLanguageText: 'Language',
notes: enNotes,
navbar: [
{ text: 'Home', link: '/en/', icon: 'material-symbols:home-outline' },
{
text: 'Blog',
link: '/en/blog/',
icon: 'material-symbols:article-outline',
},
{
text: 'VuePress',
icon: 'vscode-icons:file-type-vue',
items: [
{
text: 'Plugin',
icon: 'mingcute:plugin-2-line',
items: [
{
text: 'caniuse',
link: '/en/note/vuepress-plugin/caniuse/',
icon: 'tabler:brand-css3',
},
],
},
],
},
],
},
},
}),
})

View File

@ -1,6 +1,6 @@
import { definePlumeNotesConfig } from '@vuepress-plume/vuepress-theme-plume'
export default definePlumeNotesConfig({
export const zhNotes = definePlumeNotesConfig({
dir: 'notes',
link: '/note',
notes: [
@ -48,3 +48,16 @@ export default definePlumeNotesConfig({
},
],
})
export const enNotes = definePlumeNotesConfig({
dir: 'notes',
link: '/note',
notes: [
{
dir: 'vuepress-plugin',
text: '',
link: '/vuepress-plugin/',
sidebar: ['caniuse/README'],
},
],
})

View File

@ -0,0 +1,6 @@
---
title: english_blog
author: Plume Theme
createTime: 2023/06/15 08:51:31
permalink: /en/article/xw0awouo/
---

17
docs/en/README.md Normal file
View File

@ -0,0 +1,17 @@
---
home: true
banner: /images/bg-home.jpg
hero:
name: pengzhanbo
tagline: Front-End Developer
text: 简单介绍专业技能信息相关的描述
actions:
-
theme: brand
text: Blog
link: /en/blog/
-
theme: alt
text: Github
link: /
---

View File

@ -0,0 +1,8 @@
---
title: plugin-caniuse
author: Plume Theme
createTime: 2023/06/15 09:33:00
permalink: /en/note/vuepress-plugin/caniuse
---
## Can I Use