index.ts 882 B

123456789101112131415161718192021222324252627
  1. // https://vitepress.dev/guide/custom-theme
  2. import type { EnhanceAppContext, Theme } from 'vitepress';
  3. import { NolebaseGitChangelogPlugin } from '@nolebase/vitepress-plugin-git-changelog/client';
  4. import DefaultTheme from 'vitepress/theme';
  5. import { DemoPreview } from '../components';
  6. import SiteLayout from './components/site-layout.vue';
  7. import VbenContributors from './components/vben-contributors.vue';
  8. import { initHmPlugin } from './plugins/hm';
  9. import './styles';
  10. import '@nolebase/vitepress-plugin-git-changelog/client/style.css';
  11. export default {
  12. enhanceApp(ctx: EnhanceAppContext) {
  13. const { app } = ctx;
  14. app.component('VbenContributors', VbenContributors);
  15. app.component('DemoPreview', DemoPreview);
  16. app.use(NolebaseGitChangelogPlugin);
  17. // 百度统计
  18. initHmPlugin();
  19. },
  20. extends: DefaultTheme,
  21. Layout: SiteLayout,
  22. } satisfies Theme;