1
- const demoCode = require ( '../../src/' )
1
+ const { defineConfig } = require ( 'vuepress/config' )
2
+
3
+ const demoCode = require ( '../../src' )
2
4
const { name, description } = require ( '../../package.json' )
3
5
4
- const ecosystemItems = [
5
- { text : '📖markdown-it-vuese' , link : 'https://buptsteve.github.io/markdown-it-vuese/' } ,
6
- ]
6
+ /**
7
+ * @type {import('../../src/').DemoCodePluginOptions }
8
+ */
9
+ const demoCodeOptions = {
10
+ cssLibs : [
11
+ 'https://unpkg.com/animate.css@3.7.0/animate.min.css' ,
12
+ ] ,
13
+ showText : 'show more' ,
14
+ hideText : 'hide' ,
15
+ }
7
16
8
- module . exports = {
9
- base : '/' + name + '/' ,
17
+ module . exports = defineConfig ( {
18
+ base : `/ ${ name } /` ,
10
19
locales : {
11
20
'/' : { lang : 'en-US' , title : 'demo-code' , description } ,
12
21
'/zh/' : {
@@ -21,13 +30,8 @@ module.exports = {
21
30
] ,
22
31
plugins : [
23
32
[ 'smooth-scroll' ] ,
24
- [ demoCode , {
25
- cssLibs : [
26
- 'https://unpkg.com/animate.css@3.7.0/animate.min.css' ,
27
- ] ,
28
- showText : 'show more' ,
29
- hideText : 'hide' ,
30
- } ] ,
33
+ // @ts -ignore
34
+ [ demoCode , demoCodeOptions ] ,
31
35
] ,
32
36
markdown : {
33
37
extendMarkdown : ( md ) => {
@@ -45,27 +49,20 @@ module.exports = {
45
49
docsDir : 'docs' ,
46
50
sidebarDepth : 2 ,
47
51
editLinks : true ,
48
- serviceWorker : {
49
- updatePopup : {
50
- message : 'New content is available.' ,
51
- buttonText : 'Refresh' ,
52
- } ,
53
- } ,
54
52
locales : {
55
53
'/' : {
56
54
selectText : '🌍Languages' ,
57
55
label : 'English' ,
58
56
editLinkText : 'Edit this page on GitHub' ,
59
- serviceWorker : {
60
- updatePopup : {
61
- message : 'New content is available.' ,
62
- buttonText : 'Refresh' ,
63
- } ,
64
- } ,
65
57
nav : [
66
58
{ text : '🌱Guide' , link : '/' } ,
67
59
{ text : '😎Example' , link : '/example/' } ,
68
- { text : '🔥Ecosystem' , items : ecosystemItems } ,
60
+ {
61
+ text : '🔥Ecosystem' ,
62
+ items : [
63
+ { text : '📖markdown-it-vuese' , link : 'https://buptsteve.github.io/markdown-it-vuese/' } ,
64
+ ] ,
65
+ } ,
69
66
] ,
70
67
sidebar : {
71
68
'/example/' : [ {
@@ -80,16 +77,15 @@ module.exports = {
80
77
selectText : '🌍选择语言' ,
81
78
label : '简体中文' ,
82
79
editLinkText : '在 GitHub 上编辑此页' ,
83
- serviceWorker : {
84
- updatePopup : {
85
- message : '文档有更新。' ,
86
- buttonText : '刷新' ,
87
- } ,
88
- } ,
89
80
nav : [
90
81
{ text : '🌱指南' , link : '/zh/' } ,
91
82
{ text : '😎示例' , link : '/zh/example/' } ,
92
- { text : '🔥生态系统' , items : ecosystemItems } ,
83
+ {
84
+ text : '🔥生态系统' ,
85
+ items : [
86
+ { text : '📖markdown-it-vuese' , link : 'https://buptsteve.github.io/markdown-it-vuese/' } ,
87
+ ] ,
88
+ } ,
93
89
] ,
94
90
sidebar : {
95
91
'/zh/example/' : [ {
@@ -102,4 +98,4 @@ module.exports = {
102
98
} ,
103
99
} ,
104
100
} ,
105
- }
101
+ } ) ;
0 commit comments