FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PakePlus/scripts/gitpress.cjs at main · Sjj1024/PakePlus · GitHub
Sjj1024
/
PakePlus
Public template
Notifications
You must be signed in to change notification settings
Fork
6.7k
Star
14.5k
Code
Issues
12
Pull requests
1
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
PakePlus
/
scripts
/
gitpress.cjs
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (35 loc) · 1.23 KB
Breadcrumbs
PakePlus
/
scripts
/
gitpress.cjs
Copy path
File metadata and controls
38 lines (35 loc) · 1.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// 修改vitepress base
const
fs
=
require
(
'fs'
)
const
path
=
require
(
'path'
)
// 修改vitepress base
function
gitBase
(
)
{
console
.
log
(
'gitBase'
)
const
base
=
'/PakePlus/'
const
configPath
=
path
.
join
(
__dirname
,
'../docs/.vitepress/config.ts'
)
const
config
=
fs
.
readFileSync
(
configPath
,
'utf-8'
)
const
newConfig
=
config
.
replace
(
"base: '/'"
,
`base: '
${
base
}
'`
)
console
.
log
(
'newConfig'
,
newConfig
)
fs
.
writeFileSync
(
configPath
,
newConfig
)
}
function
copyStatic
(
)
{
console
.
log
(
'copyStatic'
)
const
staticPath
=
path
.
join
(
__dirname
,
'../docs/static'
)
const
distStaticPath
=
path
.
join
(
__dirname
,
'../docs/dist/static'
)
fs
.
cpSync
(
staticPath
,
distStaticPath
,
{
recursive
:
true
}
)
const
htmlFiles
=
[
'index_zh.html'
,
'index_en.html'
,
'index_ja.html'
]
htmlFiles
.
forEach
(
(
file
)
=>
{
fs
.
cpSync
(
path
.
join
(
__dirname
,
'../docs'
,
file
)
,
path
.
join
(
__dirname
,
'../docs/dist'
,
file
)
,
{
recursive
:
true
}
)
}
)
}
// 根据参数 修改vitepress base 或者 copy /docs/static 到 /docs/dist/static
const
callFunc
=
process
.
argv
[
2
]
console
.
log
(
'callFunc'
,
callFunc
)
if
(
callFunc
===
'gitBase'
)
{
gitBase
(
)
}
else
if
(
callFunc
===
'copyStatic'
)
{
copyStatic
(
)
}
Back
|
FazBrowse Home
|
New Git URL