1- import { h } from ' vue' ;
2- import DefaultTheme from ' vitepress/theme' ;
3- import { enhanceAppWithTabs } from ' vitepress-plugin-tabs/client' ;
4- import ' ./styles/custom.css' ;
5- import ChatPanel from ' ./components/ChatPanel.vue' ;
6- import ChatMessage from ' ./components/ChatMessage.vue' ;
1+ import { h } from " vue" ;
2+ import DefaultTheme from " vitepress/theme" ;
3+ import { enhanceAppWithTabs } from " vitepress-plugin-tabs/client" ;
4+ import " ./styles/custom.css" ;
5+ import ChatPanel from " ./components/ChatPanel.vue" ;
6+ import ChatMessage from " ./components/ChatMessage.vue" ;
77
8- import { Theme } from ' vitepress' ;
8+ import { Theme } from " vitepress" ;
99
1010import {
1111 InjectionKey as NolebaseEnhancedReadabilitiesInjectionKey ,
1212 LayoutMode as NolebaseEnhancedReadabilitiesLayoutMode ,
1313 NolebaseEnhancedReadabilitiesMenu ,
1414 NolebaseEnhancedReadabilitiesScreenMenu ,
15- } from ' @nolebase/vitepress-plugin-enhanced-readabilities/client' ;
15+ } from " @nolebase/vitepress-plugin-enhanced-readabilities/client" ;
1616
17- import { NolebaseInlineLinkPreviewPlugin } from ' @nolebase/vitepress-plugin-inline-link-preview/client' ;
17+ import { NolebaseInlineLinkPreviewPlugin } from " @nolebase/vitepress-plugin-inline-link-preview/client" ;
1818
19- import { NolebaseHighlightTargetedHeading } from ' @nolebase/vitepress-plugin-highlight-targeted-heading/client' ;
19+ import { NolebaseHighlightTargetedHeading } from " @nolebase/vitepress-plugin-highlight-targeted-heading/client" ;
2020
2121import {
2222 InjectionKey ,
2323 NolebaseGitChangelogPlugin ,
24- } from ' @nolebase/vitepress-plugin-git-changelog/client' ;
24+ } from " @nolebase/vitepress-plugin-git-changelog/client" ;
2525
26- import { NolebasePagePropertiesPlugin } from ' @nolebase/vitepress-plugin-page-properties/client' ;
26+ import { NolebasePagePropertiesPlugin } from " @nolebase/vitepress-plugin-page-properties/client" ;
2727
28- import { NolebaseUnlazyImg } from ' @nolebase/vitepress-plugin-thumbnail-hash/client' ;
28+ import { NolebaseUnlazyImg } from " @nolebase/vitepress-plugin-thumbnail-hash/client" ;
2929
30- import AppContainer from './components/AppContainer.vue' ;
30+ import AppContainer from "./components/AppContainer.vue" ;
31+ import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
3132
32- import ' @nolebase/vitepress-plugin-enhanced-readabilities/client/style.css' ;
33- import ' @nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css' ;
34- import ' @nolebase/vitepress-plugin-inline-link-preview/client/style.css' ;
35- import ' @nolebase/vitepress-plugin-git-changelog/client/style.css' ;
36- import ' @nolebase/vitepress-plugin-page-properties/client/style.css' ;
37- import ' @nolebase/vitepress-plugin-thumbnail-hash/client/style.css' ;
38- import ' @nolebase/vitepress-plugin-enhanced-mark/client/style.css' ;
33+ import " @nolebase/vitepress-plugin-enhanced-readabilities/client/style.css" ;
34+ import " @nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css" ;
35+ import " @nolebase/vitepress-plugin-inline-link-preview/client/style.css" ;
36+ import " @nolebase/vitepress-plugin-git-changelog/client/style.css" ;
37+ import " @nolebase/vitepress-plugin-page-properties/client/style.css" ;
38+ import " @nolebase/vitepress-plugin-thumbnail-hash/client/style.css" ;
39+ import " @nolebase/vitepress-plugin-enhanced-mark/client/style.css" ;
3940
40- import ' virtual:uno.css'
41+ import " virtual:uno.css" ;
4142
42- import ' ./styles/main.css' ;
43- import ' ./styles/vars.css' ;
44- import ' ./styles/sponsor.css' ;
43+ import " ./styles/main.css" ;
44+ import " ./styles/vars.css" ;
45+ import " ./styles/sponsor.css" ;
4546
46- import '@shikijs/vitepress-twoslash/style.css' ;
47- import Sponsors from ' ./components/Sponsors.vue' ;
47+ import '@shikijs/vitepress-twoslash/style.css'
48+ import Sponsors from " ./components/Sponsors.vue" ;
4849
49- import ( ' @nolebase/vitepress-plugin-inline-link-preview/client' ) ;
50+ import ( " @nolebase/vitepress-plugin-inline-link-preview/client" ) ;
5051
5152export default {
5253 extends : DefaultTheme ,
5354 Layout : ( ) => {
5455 return h ( DefaultTheme . Layout , null , {
5556 // https://vitepress.dev/guide/extending-default-theme#layout-slots
56- ' doc-top' : ( ) => [ h ( NolebaseHighlightTargetedHeading ) ] ,
57- ' nav-bar-content-after' : ( ) => [
57+ " doc-top" : ( ) => [ h ( NolebaseHighlightTargetedHeading ) ] ,
58+ " nav-bar-content-after" : ( ) => [
5859 h ( NolebaseEnhancedReadabilitiesMenu ) ,
5960 ] ,
60- ' nav-screen-content-after' : ( ) => [
61+ " nav-screen-content-after" : ( ) => [
6162 h ( NolebaseEnhancedReadabilitiesScreenMenu ) ,
6263 ] ,
6364 } ) ;
6465 } ,
6566 enhanceApp ( { app } ) {
66- app . component ( ' chat-panel' , ChatPanel ) ;
67- app . component ( ' chat-message' , ChatMessage ) ;
68- app . component ( ' sponsors' , Sponsors ) ;
67+ app . component ( " chat-panel" , ChatPanel ) ;
68+ app . component ( " chat-message" , ChatMessage ) ;
69+ app . component ( " sponsors" , Sponsors ) ;
6970
7071 enhanceAppWithTabs ( app ) ;
7172
@@ -76,8 +77,8 @@ export default {
7677 * https://github.com/vuejs/vitepress/issues/1918
7778 */
7879
79- app . component ( ' AppContainer' , AppContainer ) ;
80- app . component ( ' NolebaseUnlazyImg' , NolebaseUnlazyImg ) ;
80+ app . component ( " AppContainer" , AppContainer ) ;
81+ app . component ( " NolebaseUnlazyImg" , NolebaseUnlazyImg ) ;
8182
8283 app . provide ( NolebaseEnhancedReadabilitiesInjectionKey , {
8384 layoutSwitch : {
@@ -87,7 +88,7 @@ export default {
8788 spotlight : {
8889 disableHelp : true ,
8990 defaultToggle : true ,
90- hoverBlockColor : ' rgb(240 197 52 / 7%)' ,
91+ hoverBlockColor : " rgb(240 197 52 / 7%)" ,
9192 } ,
9293 } ) ;
9394
@@ -98,30 +99,31 @@ export default {
9899
99100 app . use ( NolebaseInlineLinkPreviewPlugin ) ;
100101 app . use ( NolebaseGitChangelogPlugin ) ;
102+ app . use ( TwoslashFloatingVue ) ;
101103 app . use (
102104 NolebasePagePropertiesPlugin < {
103105 progress : number ;
104106 } > ( ) ,
105107 {
106108 properties : {
107- ' zh-CN' : [
109+ " zh-CN" : [
108110 {
109- key : ' wordCount' ,
110- type : ' dynamic' ,
111- title : '字数' ,
111+ key : " wordCount" ,
112+ type : " dynamic" ,
113+ title : "字数" ,
112114 options : {
113- type : ' wordsCount' ,
115+ type : " wordsCount" ,
114116 } ,
115117 } ,
116118 {
117- key : ' readingTime' ,
118- type : ' dynamic' ,
119- title : ' 阅读时间' ,
119+ key : " readingTime" ,
120+ type : " dynamic" ,
121+ title : " 阅读时间" ,
120122 options : {
121- type : ' readingTime' ,
122- dateFnsLocaleName : ' zhCN' ,
123+ type : " readingTime" ,
124+ dateFnsLocaleName : " zhCN" ,
123125 } ,
124- }
126+ } ,
125127 ] ,
126128 } ,
127129 }
0 commit comments