docs: 调整 docs 示例配置
This commit is contained in:
parent
5ff9570018
commit
dc7474fcd7
@ -3,8 +3,7 @@ import process from 'node:process'
|
|||||||
import { viteBundler } from '@vuepress/bundler-vite'
|
import { viteBundler } from '@vuepress/bundler-vite'
|
||||||
import { webpackBundler } from '@vuepress/bundler-webpack'
|
import { webpackBundler } from '@vuepress/bundler-webpack'
|
||||||
import { defineUserConfig } from '@vuepress/cli'
|
import { defineUserConfig } from '@vuepress/cli'
|
||||||
import themePlume from 'vuepress-theme-plume'
|
import { theme } from './theme.js'
|
||||||
import { enNotes, zhNotes } from './notes.js'
|
|
||||||
|
|
||||||
export default defineUserConfig({
|
export default defineUserConfig({
|
||||||
base: '/',
|
base: '/',
|
||||||
@ -14,117 +13,9 @@ export default defineUserConfig({
|
|||||||
source: path.resolve(__dirname, '../'),
|
source: path.resolve(__dirname, '../'),
|
||||||
public: path.resolve(__dirname, 'public'),
|
public: path.resolve(__dirname, 'public'),
|
||||||
locales: {
|
locales: {
|
||||||
'/': {
|
'/': { title: 'Plume主题', description: '', lang: 'zh-CN' },
|
||||||
title: 'Plume主题',
|
'/en/': { title: 'Plume Theme', description: '', lang: 'en' },
|
||||||
description: '',
|
|
||||||
lang: 'zh-CN',
|
|
||||||
},
|
|
||||||
'/en/': {
|
|
||||||
title: 'Plume Theme',
|
|
||||||
description: '',
|
|
||||||
lang: 'en',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
bundler: process.env.DOCS_BUNDLER === 'webpack' ? webpackBundler() : viteBundler(),
|
||||||
bundler:
|
theme,
|
||||||
process.env.DOCS_BUNDLER === 'webpack' ? webpackBundler() : viteBundler(),
|
|
||||||
|
|
||||||
theme: themePlume({
|
|
||||||
logo: 'https://pengzhanbo.cn/g.gif',
|
|
||||||
hostname: 'https://pengzhanbo.cn',
|
|
||||||
repo: 'https://github.com/pengzhanbo/vuepress-theme-plume',
|
|
||||||
docsDir: 'docs',
|
|
||||||
editLink: true,
|
|
||||||
editLinkText: 'Edit this page on GitHub',
|
|
||||||
appearance: true,
|
|
||||||
avatar: {
|
|
||||||
url: '/images/blogger.jpg',
|
|
||||||
name: 'Plume Theme',
|
|
||||||
description: 'The Theme for Vuepress 2.0',
|
|
||||||
},
|
|
||||||
social: [{ icon: 'github', link: 'https://github.com/pengzhanbo' }],
|
|
||||||
notes: zhNotes,
|
|
||||||
navbar: [
|
|
||||||
{ text: '首页', link: '/', icon: 'material-symbols:home-outline' },
|
|
||||||
{
|
|
||||||
text: '博客',
|
|
||||||
link: '/blog/',
|
|
||||||
icon: 'material-symbols:article-outline',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'VuePress',
|
|
||||||
icon: 'vscode-icons:file-type-vue',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
text: 'theme-plume',
|
|
||||||
link: '/note/vuepress-theme-plume/',
|
|
||||||
icon: 'icon-park-outline:theme',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '插件',
|
|
||||||
icon: 'mingcute:plugin-2-line',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
text: 'caniuse',
|
|
||||||
link: '/note/vuepress-plugin/caniuse/',
|
|
||||||
icon: 'tabler:brand-css3',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'netlify-functions',
|
|
||||||
link: '/note/vuepress-plugin/netlify-functions/',
|
|
||||||
icon: 'teenyicons:netlify-outline',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{ text: '友情链接', link: '/friends/', icon: 'emojione-monotone:roller-coaster' },
|
|
||||||
],
|
|
||||||
footer: {
|
|
||||||
copyright: 'Copyright © 2022-present pengzhanbo',
|
|
||||||
},
|
|
||||||
themePlugins: {
|
|
||||||
markdownEnhance: { katex: true },
|
|
||||||
search: {
|
|
||||||
locales: {
|
|
||||||
'/': {
|
|
||||||
placeholder: '搜索',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
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',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
|
|||||||
64
docs/.vuepress/navbar.ts
Normal file
64
docs/.vuepress/navbar.ts
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import type { NavItem } from 'vuepress-theme-plume'
|
||||||
|
|
||||||
|
export const zhNavbar = [
|
||||||
|
{ text: '首页', link: '/', icon: 'material-symbols:home-outline' },
|
||||||
|
{
|
||||||
|
text: '博客',
|
||||||
|
link: '/blog/',
|
||||||
|
icon: 'material-symbols:article-outline',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'VuePress',
|
||||||
|
icon: 'vscode-icons:file-type-vue',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'theme-plume',
|
||||||
|
link: '/note/vuepress-theme-plume/',
|
||||||
|
icon: 'icon-park-outline:theme',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '插件',
|
||||||
|
icon: 'mingcute:plugin-2-line',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'caniuse',
|
||||||
|
link: '/note/vuepress-plugin/caniuse/',
|
||||||
|
icon: 'tabler:brand-css3',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'netlify-functions',
|
||||||
|
link: '/note/vuepress-plugin/netlify-functions/',
|
||||||
|
icon: 'teenyicons:netlify-outline',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{ text: '友情链接', link: '/friends/', icon: 'emojione-monotone:roller-coaster' },
|
||||||
|
] as NavItem[]
|
||||||
|
|
||||||
|
export const enNavbar = [
|
||||||
|
{ 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',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
] as NavItem[]
|
||||||
@ -5,7 +5,6 @@ export const zhNotes = definePlumeNotesConfig({
|
|||||||
link: '/note',
|
link: '/note',
|
||||||
notes: [
|
notes: [
|
||||||
{
|
{
|
||||||
text: '',
|
|
||||||
dir: 'vuepress-theme-plume',
|
dir: 'vuepress-theme-plume',
|
||||||
link: '/vuepress-theme-plume/',
|
link: '/vuepress-theme-plume/',
|
||||||
sidebar: [
|
sidebar: [
|
||||||
@ -34,7 +33,6 @@ export const zhNotes = definePlumeNotesConfig({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
dir: 'vuepress-plugin',
|
dir: 'vuepress-plugin',
|
||||||
text: '',
|
|
||||||
link: '/vuepress-plugin/',
|
link: '/vuepress-plugin/',
|
||||||
sidebar: [
|
sidebar: [
|
||||||
'caniuse/README',
|
'caniuse/README',
|
||||||
@ -50,12 +48,11 @@ export const zhNotes = definePlumeNotesConfig({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const enNotes = definePlumeNotesConfig({
|
export const enNotes = definePlumeNotesConfig({
|
||||||
dir: 'notes',
|
dir: 'en/notes',
|
||||||
link: '/note',
|
link: '/en/note',
|
||||||
notes: [
|
notes: [
|
||||||
{
|
{
|
||||||
dir: 'vuepress-plugin',
|
dir: 'vuepress-plugin',
|
||||||
text: '',
|
|
||||||
link: '/vuepress-plugin/',
|
link: '/vuepress-plugin/',
|
||||||
sidebar: ['caniuse/README'],
|
sidebar: ['caniuse/README'],
|
||||||
},
|
},
|
||||||
|
|||||||
49
docs/.vuepress/theme.ts
Normal file
49
docs/.vuepress/theme.ts
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
import themePlume from 'vuepress-theme-plume'
|
||||||
|
import { enNotes, zhNotes } from './notes.js'
|
||||||
|
import { enNavbar, zhNavbar } from './navbar.js'
|
||||||
|
|
||||||
|
export const theme = themePlume({
|
||||||
|
logo: 'https://pengzhanbo.cn/g.gif',
|
||||||
|
hostname: 'https://pengzhanbo.cn',
|
||||||
|
repo: 'https://github.com/pengzhanbo/vuepress-theme-plume',
|
||||||
|
docsDir: 'docs',
|
||||||
|
editLink: true,
|
||||||
|
editLinkText: '在 GitHub 编辑此页',
|
||||||
|
appearance: true,
|
||||||
|
avatar: {
|
||||||
|
url: '/images/blogger.jpg',
|
||||||
|
name: 'Plume Theme',
|
||||||
|
description: 'The Theme for Vuepress 2.0',
|
||||||
|
},
|
||||||
|
social: [{ icon: 'github', link: 'https://github.com/pengzhanbo' }],
|
||||||
|
footer: { copyright: 'Copyright © 2022-present pengzhanbo' },
|
||||||
|
|
||||||
|
locales: {
|
||||||
|
'/': {
|
||||||
|
selectLanguageName: '简体中文',
|
||||||
|
selectLanguageText: '选择语言',
|
||||||
|
notes: zhNotes,
|
||||||
|
navbar: zhNavbar,
|
||||||
|
},
|
||||||
|
'/en/': {
|
||||||
|
selectLanguageName: 'English',
|
||||||
|
selectLanguageText: 'Language',
|
||||||
|
editLinkText: 'Edit this page on GitHub',
|
||||||
|
notes: enNotes,
|
||||||
|
navbar: enNavbar,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
markdownEnhance: { katex: true },
|
||||||
|
search: {
|
||||||
|
locales: {
|
||||||
|
'/': {
|
||||||
|
placeholder: '搜索',
|
||||||
|
},
|
||||||
|
'/en/': {
|
||||||
|
placeholder: 'Search',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user