|
| 1 | +import { defineUserConfig } from 'vuepress' |
| 2 | +import searchPlugin from '@vuepress/plugin-search' |
| 3 | +import { defaultTheme } from '@vuepress/theme-default' |
| 4 | +import smoothScrollPlugin from 'vuepress-plugin-smooth-scroll' |
| 5 | + |
| 6 | +import includePlugin from './include-plugin' |
| 7 | +import { demoCodePlugin } from '../../src/node' |
| 8 | +import { name, description } from '../../package.json' |
| 9 | + |
| 10 | +const ecosystemItems = [ |
| 11 | + { text: '📖markdown-it-vuese', link: 'https://buptsteve.github.io/markdown-it-vuese/' }, |
| 12 | +] |
| 13 | + |
| 14 | +export default defineUserConfig({ |
| 15 | + base: `/${name}/`, |
| 16 | + locales: { |
| 17 | + '/': { lang: 'en-US', title: 'demo-code', description }, |
| 18 | + '/zh/': { |
| 19 | + lang: 'zh-CN', |
| 20 | + title: 'demo-code', |
| 21 | + description: '📝 同时展示 demo 和 code 的 vuepress 插件', |
| 22 | + }, |
| 23 | + }, |
| 24 | + head: [ |
| 25 | + ['link', { rel: 'icon', href: '/favicon.ico' }], |
| 26 | + ['link', { rel: 'stylesheet', href: 'https://unpkg.com/animate.css@3.7.0/animate.min.css' }], |
| 27 | + ], |
| 28 | + plugins: [ |
| 29 | + includePlugin, |
| 30 | + // @ts-ignore |
| 31 | + smoothScrollPlugin, |
| 32 | + demoCodePlugin({ |
| 33 | + cssLibs: [ |
| 34 | + 'https://unpkg.com/animate.css@3.7.0/animate.min.css', |
| 35 | + ], |
| 36 | + showText: 'show more', |
| 37 | + hideText: 'hide', |
| 38 | + }), |
| 39 | + searchPlugin({ |
| 40 | + locales: { |
| 41 | + '/': { |
| 42 | + placeholder: 'Search', |
| 43 | + }, |
| 44 | + '/zh/': { |
| 45 | + placeholder: '搜索', |
| 46 | + }, |
| 47 | + }, |
| 48 | + }), |
| 49 | + ], |
| 50 | + theme: defaultTheme({ |
| 51 | + repo: 'BuptStEve/' + name, |
| 52 | + docsDir: 'docs', |
| 53 | + contributors: false, |
| 54 | + locales: { |
| 55 | + '/': { |
| 56 | + selectLanguageText: '🌍Languages', |
| 57 | + selectLanguageName: 'English', |
| 58 | + editLinkText: 'Edit this page on GitHub', |
| 59 | + navbar: [ |
| 60 | + { text: '🌱Guide', link: '/' }, |
| 61 | + { text: '😎Example', link: '/example/' }, |
| 62 | + { text: '🔥Ecosystem', children: ecosystemItems }, |
| 63 | + ], |
| 64 | + sidebar: [ |
| 65 | + { text: '🌱Guide', link: '/' }, |
| 66 | + { text: '😎Example', link: '/example/' }, |
| 67 | + ], |
| 68 | + }, |
| 69 | + '/zh/': { |
| 70 | + selectLanguageText: '🌍选择语言', |
| 71 | + selectLanguageName: '简体中文', |
| 72 | + editLinkText: '在 GitHub 上编辑此页', |
| 73 | + navbar: [ |
| 74 | + { text: '🌱指南', link: '/zh/' }, |
| 75 | + { text: '😎示例', link: '/zh/example/' }, |
| 76 | + { text: '🔥生态系统', children: ecosystemItems }, |
| 77 | + ], |
| 78 | + sidebar: [ |
| 79 | + { text: '🌱指南', link: '/zh/' }, |
| 80 | + { text: '😎示例', link: '/zh/example/' }, |
| 81 | + ], |
| 82 | + }, |
| 83 | + }, |
| 84 | + }), |
| 85 | +}) |
0 commit comments