config.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import {defineConfig} from 'vitepress';
  2. import {applyPlugins} from '@ruabick/md-demo-plugins';
  3. import {genTemp} from '@ruabick/vite-plugin-gen-temp';
  4. import {genApiDoc} from '@ruabick/vite-plugin-gen-api-doc';
  5. import {version} from 'hc-vue3-ui'
  6. import {sidebar} from './sidebar.js';
  7. import {resolve} from 'path';
  8. export default defineConfig({
  9. lang: 'zh-CN',
  10. lastUpdated: true,
  11. title: "hc-vue3-ui",
  12. themeConfig: {
  13. logo: '/favicon.ico',
  14. outlineTitle: '此页的大纲',
  15. nav: [
  16. {
  17. text: '使用说明',
  18. link: '/guide/index'
  19. },
  20. {
  21. text: '组件库',
  22. link: '/components/app-config/index'
  23. },
  24. {
  25. text: 'API函数',
  26. link: '/api/storage/index'
  27. },
  28. {
  29. text: '样式说明',
  30. link: '/style/base/index'
  31. },
  32. {
  33. text: '资料导航',
  34. link: '/guide/nav'
  35. },
  36. {
  37. text: version,
  38. items: [
  39. {
  40. text: '更新日志',
  41. link: '/CHANGELOG.md'
  42. }
  43. ]
  44. }
  45. ],
  46. sidebar,
  47. search: {
  48. provider: 'local'
  49. }
  50. },
  51. vue: {},
  52. vite: {
  53. resolve: {
  54. alias: {
  55. 'docs': resolve('./src/'),
  56. },
  57. },
  58. plugins: [
  59. genTemp(),
  60. genApiDoc(),
  61. ],
  62. server: {
  63. port: 3300,
  64. }
  65. },
  66. markdown: {
  67. config: (md) => {
  68. applyPlugins(md);
  69. },
  70. theme: {
  71. light: 'github-light',
  72. dark: 'github-dark',
  73. },
  74. },
  75. buildEnd() {
  76. process.exit(0);
  77. },
  78. });