File tree Expand file tree Collapse file tree 4 files changed +9
-32
lines changed Expand file tree Collapse file tree 4 files changed +9
-32
lines changed Original file line number Diff line number Diff line change 11import path from 'node:path'
22import { defineConfig } from 'vitepress'
3- import type { DefaultTheme } from 'vitepress/types/default-theme'
43import { getThemeConfig , getVipFooter , zhSearch } from '@142vip/vitepress'
54import { OPEN_SOURCE_ADDRESS , getDocSiteBase } from '@142vip/utils'
5+ import type { NavbarConfig } from '@142vip/vitepress'
66import { name as pkgName , version as pkgVersion } from '../package.json'
77import { getChangelogsSidebar , sidebarConfig } from './sidebar'
88
99/**
1010 * 导航栏
1111 */
12- const navbarConfig : DefaultTheme . NavItem [ ] = [
12+ const navbarConfig : NavbarConfig = [
1313 {
1414 text : '🔥 首页' ,
1515 link : '/docs/index.md' ,
Original file line number Diff line number Diff line change 1- import type { VipProject } from '@142vip/vitepress'
1+ import type { SidebarConfig , VipProject } from '@142vip/vitepress'
22import type { DefaultTheme } from 'vitepress/types/default-theme'
33import { pick } from '@142vip/vitepress'
44
@@ -14,7 +14,7 @@ enum ProjectId {
1414/**
1515 * 侧边栏
1616 */
17- export const sidebarConfig : DefaultTheme . SidebarItem [ ] = [
17+ export const sidebarConfig : SidebarConfig = [
1818 {
1919 text : `🏆 ${ ProjectId . Infra } ` ,
2020 items : [
Original file line number Diff line number Diff line change 11<script lang="ts" setup>
2- import { defineComponent , onMounted , ref } from ' vue'
2+ import { onMounted , ref } from ' vue'
33import {
44 VipBackTop ,
55 VipContactAuthor ,
66 VipProjectTable ,
77 VipTeam ,
88} from ' @142vip/vitepress/components'
99import { useData } from ' vitepress'
10- import { ElImage } from ' element-plus'
1110import { getCoreProjectData , getExampleDemoTableData } from ' ../../sidebar'
1211
1312const { isDark } = useData ()
1413const coreProjectTableData = ref <any []>([])
1514const exampleDemoTableData = ref ()
1615
17- defineComponent ({
18- components: {
19- ElImage ,
20- },
21- })
22-
2316/**
2417 * 异步加载表格数据
2518 */
@@ -87,14 +80,14 @@ onMounted(async () => {
8780 <h2 >趋势</h2 >
8881 <!-- 支持黑色主题 -->
8982 <div class =" star-history" >
90- <ElImage
83+ <img
9184 :src =" `https://api.star-history.com/svg?repos=142vip/core-x,142vip/408CSFamily,142vip/JavaScriptCollection&type=Date${
9285 isDark ? '&theme=dark' : ''
9386 }`"
9487 class =" img-border"
9588 alt =" Github Star History"
9689 title =" Github Star History"
97- / >
90+ >
9891 </div >
9992 </section >
10093
Original file line number Diff line number Diff line change 1- import { h } from 'vue'
2- import DefaultTheme from 'vitepress/theme'
1+ import defineVipExtendsTheme from '@142vip/vitepress/theme'
32import './style.css'
4- import type { Theme } from 'vitepress'
5- import { VipBackTop } from '@142vip/vitepress/components'
6- // 导入 element-plus样式
7- // import 'element-plus/dist/index.css'
83
94/**
105 * 自定义主题
116 * 参考: https://vitepress.dev/guide/custom-theme
127 */
13- export default {
14- extends : DefaultTheme ,
15- Layout : ( ) => {
16- return h ( DefaultTheme . Layout , null , {
17- // https://vitepress.dev/guide/extending-default-theme#layout-slots
18- 'doc-bottom' : ( ) => h ( VipBackTop ) ,
19- } )
20- } ,
21- // todo 查看这里的app、router、siteData的作用
22- enhanceApp ( ) {
23- } ,
24- } satisfies Theme
8+ export default defineVipExtendsTheme ( )
You can’t perform that action at this time.
0 commit comments