@@ -2,29 +2,63 @@ import fs from 'fs'
2
2
import path from 'path'
3
3
import dotenv from 'dotenv'
4
4
5
- import { defaultTheme , viteBundler } from 'vuepress'
5
+ import { viteBundler } from '@vuepress/bundler-vite'
6
+ import { defaultTheme } from '@vuepress/theme-default'
7
+ import { defineUserConfig } from 'vuepress'
6
8
7
9
dotenv . config ( )
8
10
11
+ function getChildren ( folder , sort = 'asc' ) {
12
+ const extension = [ '.md' ]
13
+ const names = [ 'index.md' , 'readme.md' ]
14
+
15
+ const dir = `${ __dirname } /../${ folder } `
16
+
17
+ return fs
18
+ . readdirSync ( path . join ( dir ) )
19
+ . filter ( item =>
20
+ fs . statSync ( path . join ( dir , item ) ) . isFile ( ) &&
21
+ ! names . includes ( item . toLowerCase ( ) ) &&
22
+ extension . includes ( path . extname ( item ) )
23
+ )
24
+ . sort ( ( a , b ) => {
25
+ a = resolveNumeric ( a )
26
+ b = resolveNumeric ( b )
27
+
28
+ if ( a < b ) return sort === 'asc' ? - 1 : 1
29
+ if ( a > b ) return sort === 'asc' ? 1 : - 1
30
+
31
+ return 0
32
+ } ) . map ( item => `/${ folder } /${ item } ` )
33
+ }
34
+
35
+ function resolveNumeric ( value ) {
36
+ const sub = value . substring ( 0 , value . indexOf ( '.' ) )
37
+
38
+ const num = Number ( sub )
39
+
40
+ return isNaN ( num ) ? value : num
41
+ }
42
+
9
43
const hostname = 'actions.dragon-code.pro'
10
44
11
- module . exports = {
45
+ export default defineUserConfig ( {
46
+ bundler : viteBundler ( ) ,
47
+
12
48
lang : 'en-US' ,
13
49
title : 'Dragon Code: Actions' ,
14
50
description : 'Performing actions with saving the list of called files' ,
15
51
16
52
head : [
17
- [ 'link' , { rel : 'icon' , href : `https://${ hostname } /images/logo.svg` } ] ,
18
- [ 'meta' , { name : 'twitter:image' , content : `https://${ hostname } /images/logo.svg` } ]
53
+ [ 'link' , { rel : 'icon' , href : `https://${ hostname } /images/logo.svg` } ] ,
54
+ [ 'meta' , { name : 'twitter:image' , content : `https://${ hostname } /images/logo.svg` } ]
19
55
] ,
20
56
21
- bundler : viteBundler ( ) ,
22
-
23
57
theme : defaultTheme ( {
24
58
hostname,
25
59
base : '/' ,
26
60
27
- logo : `https://${ hostname } /images/logo.svg` ,
61
+ logo : `https://${ hostname } /images/logo.svg` ,
28
62
29
63
repo : 'https://github.com/TheDragonCode/laravel-actions' ,
30
64
repoLabel : 'GitHub' ,
@@ -36,7 +70,7 @@ module.exports = {
36
70
editLink : true ,
37
71
38
72
navbar : [
39
- { text : '4.x' , link : '/prologue/changelog/4.x.md' }
73
+ { text : '4.x' , link : '/prologue/changelog/4.x.md' }
40
74
] ,
41
75
42
76
sidebarDepth : 1 ,
@@ -83,36 +117,4 @@ module.exports = {
83
117
}
84
118
]
85
119
} )
86
- }
87
-
88
- function getChildren ( folder , sort = 'asc' ) {
89
- const extension = [ '.md' ]
90
- const names = [ 'index.md' , 'readme.md' ]
91
-
92
- const dir = `${ __dirname } /../${ folder } `
93
-
94
- return fs
95
- . readdirSync ( path . join ( dir ) )
96
- . filter ( item =>
97
- fs . statSync ( path . join ( dir , item ) ) . isFile ( ) &&
98
- ! names . includes ( item . toLowerCase ( ) ) &&
99
- extension . includes ( path . extname ( item ) )
100
- )
101
- . sort ( ( a , b ) => {
102
- a = resolveNumeric ( a )
103
- b = resolveNumeric ( b )
104
-
105
- if ( a < b ) return sort === 'asc' ? - 1 : 1
106
- if ( a > b ) return sort === 'asc' ? 1 : - 1
107
-
108
- return 0
109
- } ) . map ( item => `/${ folder } /${ item } ` )
110
- }
111
-
112
- function resolveNumeric ( value ) {
113
- const sub = value . substring ( 0 , value . indexOf ( '.' ) )
114
-
115
- const num = Number ( sub )
116
-
117
- return isNaN ( num ) ? value : num
118
- }
120
+ } )
0 commit comments