create-vuepress-theme-hope 2.0.0-beta.20 → 2.0.0-beta.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +35 -0
- package/lib/index.js +66 -0
- package/package.json +25 -14
- package/template/blog/.vuepress/config.ts +24 -0
- package/template/blog/.vuepress/navbar/en.ts +52 -0
- package/template/blog/.vuepress/navbar/index.ts +2 -0
- package/template/blog/.vuepress/navbar/zh.ts +52 -0
- package/template/blog/.vuepress/sidebar/en.ts +22 -0
- package/template/blog/.vuepress/sidebar/index.ts +2 -0
- package/template/blog/.vuepress/sidebar/zh.ts +22 -0
- package/template/blog/.vuepress/styles/config.scss +3 -0
- package/template/blog/.vuepress/styles/index.scss +1 -0
- package/template/blog/.vuepress/styles/palette.scss +2 -0
- package/template/blog/.vuepress/theme.ts +224 -0
- package/template/{i18n → blog}/README.md +5 -5
- package/template/{i18n/guide → blog/demo}/README.md +5 -4
- package/template/{i18n/guide → blog/demo}/disable.md +4 -4
- package/template/{i18n/guide → blog/demo}/encrypt.md +1 -1
- package/template/blog/demo/markdown.md +411 -0
- package/template/blog/demo/page.md +72 -0
- package/template/blog/intro.md +7 -0
- package/template/{i18n/posts/article/article1.md → blog/posts/apple/1.md} +5 -4
- package/template/{en-US/posts/article/article2.md → blog/posts/apple/2.md} +9 -4
- package/template/{i18n/posts/article/article3.md → blog/posts/apple/3.md} +6 -5
- package/template/{i18n/posts/article/article4.md → blog/posts/apple/4.md} +6 -5
- package/template/{en-US/posts/article/article5.md → blog/posts/banana/1.md} +6 -5
- package/template/{en-US/posts/article/article6.md → blog/posts/banana/2.md} +10 -5
- package/template/{i18n/posts/article/article7.md → blog/posts/banana/3.md} +5 -5
- package/template/{i18n/posts/article/article8.md → blog/posts/banana/4.md} +5 -5
- package/template/{i18n/posts/article9.md → blog/posts/cherry.md} +5 -5
- package/template/{i18n/posts/article10.md → blog/posts/dragonfruit.md} +5 -5
- package/template/{i18n/posts/article11.md → blog/posts/strawberry.md} +5 -5
- package/template/{en-US/posts/article12.md → blog/posts/tomato.md} +5 -5
- package/template/{i18n/slide.md → blog/slides.md} +8 -8
- package/template/{i18n → blog}/zh/README.md +4 -4
- package/template/{i18n/zh/guide → blog/zh/demo}/README.md +5 -4
- package/template/{i18n/zh/guide → blog/zh/demo}/disable.md +4 -4
- package/template/blog/zh/demo/markdown.md +391 -0
- package/template/blog/zh/demo/page.md +72 -0
- package/template/blog/zh/intro.md +7 -0
- package/template/{i18n/zh/posts/article/article1.md → blog/zh/posts/apple/1.md} +5 -4
- package/template/{zh-CN/posts/article/article2.md → blog/zh/posts/apple/2.md} +9 -4
- package/template/{i18n/zh/posts/article/article3.md → blog/zh/posts/apple/3.md} +6 -5
- package/template/{zh-CN/posts/article/article4.md → blog/zh/posts/apple/4.md} +6 -5
- package/template/{i18n/zh/posts/article/article5.md → blog/zh/posts/banana/1.md} +6 -5
- package/template/{i18n/zh/posts/article/article6.md → blog/zh/posts/banana/2.md} +10 -5
- package/template/{i18n/zh/posts/article/article7.md → blog/zh/posts/banana/3.md} +5 -5
- package/template/{i18n/zh/posts/article/article8.md → blog/zh/posts/banana/4.md} +5 -5
- package/template/{i18n/zh/posts/article9.md → blog/zh/posts/cherry.md} +5 -5
- package/template/{i18n/zh/posts/article10.md → blog/zh/posts/dragonfruit.md} +5 -5
- package/template/{i18n/zh/posts/article11.md → blog/zh/posts/strawberry.md} +5 -5
- package/template/{i18n/zh/posts/article12.md → blog/zh/posts/tomato.md} +5 -5
- package/template/{i18n/zh/slide.md → blog/zh/slides.md} +1 -1
- package/template/docs/.vuepress/config.ts +24 -0
- package/template/docs/.vuepress/navbar/en.ts +30 -0
- package/template/docs/.vuepress/navbar/index.ts +2 -0
- package/template/docs/.vuepress/navbar/zh.ts +30 -0
- package/template/docs/.vuepress/sidebar/en.ts +21 -0
- package/template/docs/.vuepress/sidebar/index.ts +2 -0
- package/template/docs/.vuepress/sidebar/zh.ts +21 -0
- package/template/docs/.vuepress/styles/config.scss +3 -0
- package/template/docs/.vuepress/styles/index.scss +1 -0
- package/template/docs/.vuepress/styles/palette.scss +2 -0
- package/template/docs/.vuepress/theme.ts +172 -0
- package/template/{en-US/home.md → docs/README.md} +28 -28
- package/template/{en-US/guide → docs/demo}/README.md +5 -4
- package/template/{en-US/guide → docs/demo}/disable.md +4 -4
- package/template/{en-US/guide → docs/demo}/encrypt.md +1 -1
- package/template/docs/demo/markdown.md +411 -0
- package/template/docs/demo/page.md +72 -0
- package/template/docs/guide/README.md +16 -0
- package/template/docs/guide/bar/README.md +13 -0
- package/template/docs/guide/bar/baz.md +6 -0
- package/template/docs/guide/foo/README.md +13 -0
- package/template/docs/guide/foo/ray.md +6 -0
- package/template/{en-US/slide.md → docs/slides.md} +8 -8
- package/template/{i18n/zh/home.md → docs/zh/README.md} +24 -24
- package/template/{zh-CN/guide → docs/zh/demo}/README.md +5 -4
- package/template/{zh-CN/guide → docs/zh/demo}/disable.md +4 -4
- package/template/docs/zh/demo/markdown.md +391 -0
- package/template/docs/zh/demo/page.md +72 -0
- package/template/docs/zh/guide/README.md +16 -0
- package/template/docs/zh/guide/bar/README.md +13 -0
- package/template/docs/zh/guide/bar/baz.md +6 -0
- package/template/docs/zh/guide/foo/README.md +13 -0
- package/template/docs/zh/guide/foo/ray.md +6 -0
- package/template/{zh-CN/slide.md → docs/zh/slides.md} +1 -1
- package/template/public/assets/icon/apple-icon-152.png +0 -0
- package/template/public/assets/icon/chrome-192.png +0 -0
- package/template/public/assets/icon/chrome-512.png +0 -0
- package/template/public/assets/icon/chrome-mask-192.png +0 -0
- package/template/public/assets/icon/chrome-mask-512.png +0 -0
- package/template/public/assets/icon/guide-maskable.png +0 -0
- package/template/public/assets/icon/ms-icon-144.png +0 -0
- package/CHANGELOG.md +0 -180
- package/lib/node/index.d.ts +0 -1
- package/lib/node/index.js +0 -3
- package/lib/node/index.js.map +0 -1
- package/readme.md +0 -33
- package/rollup.config.js +0 -14
- package/src/node/checkVersion.ts +0 -31
- package/src/node/copy.ts +0 -45
- package/src/node/deepAssign.ts +0 -42
- package/src/node/hasYarn.ts +0 -10
- package/src/node/i18n.ts +0 -91
- package/src/node/index.ts +0 -177
- package/src/node/registry.ts +0 -31
- package/template/en-US/.vuepress/config.ts +0 -28
- package/template/en-US/.vuepress/navbar.ts +0 -52
- package/template/en-US/.vuepress/sidebar.ts +0 -46
- package/template/en-US/.vuepress/styles/index.scss +0 -0
- package/template/en-US/.vuepress/styles/palette.scss +0 -0
- package/template/en-US/.vuepress/themeConfig.ts +0 -96
- package/template/en-US/README.md +0 -48
- package/template/en-US/guide/markdown.md +0 -341
- package/template/en-US/guide/page.md +0 -66
- package/template/en-US/intro.md +0 -7
- package/template/en-US/posts/article/article1.md +0 -19
- package/template/en-US/posts/article/article3.md +0 -20
- package/template/en-US/posts/article/article4.md +0 -20
- package/template/en-US/posts/article/article7.md +0 -20
- package/template/en-US/posts/article/article8.md +0 -20
- package/template/en-US/posts/article10.md +0 -20
- package/template/en-US/posts/article11.md +0 -20
- package/template/en-US/posts/article9.md +0 -20
- package/template/i18n/.vuepress/config.ts +0 -33
- package/template/i18n/.vuepress/navbar/en.ts +0 -52
- package/template/i18n/.vuepress/navbar/index.ts +0 -2
- package/template/i18n/.vuepress/navbar/zh.ts +0 -52
- package/template/i18n/.vuepress/public/favicon.ico +0 -0
- package/template/i18n/.vuepress/public/logo.png +0 -0
- package/template/i18n/.vuepress/public/logo.svg +0 -1
- package/template/i18n/.vuepress/sidebar/en.ts +0 -48
- package/template/i18n/.vuepress/sidebar/index.ts +0 -2
- package/template/i18n/.vuepress/sidebar/zh.ts +0 -48
- package/template/i18n/.vuepress/styles/index.scss +0 -0
- package/template/i18n/.vuepress/styles/palette.scss +0 -0
- package/template/i18n/.vuepress/themeConfig.ts +0 -124
- package/template/i18n/guide/markdown.md +0 -341
- package/template/i18n/guide/page.md +0 -66
- package/template/i18n/home.md +0 -110
- package/template/i18n/intro.md +0 -7
- package/template/i18n/posts/article/article2.md +0 -20
- package/template/i18n/posts/article/article5.md +0 -20
- package/template/i18n/posts/article/article6.md +0 -21
- package/template/i18n/posts/article12.md +0 -21
- package/template/i18n/zh/guide/markdown.md +0 -339
- package/template/i18n/zh/guide/page.md +0 -66
- package/template/i18n/zh/posts/article/article2.md +0 -20
- package/template/i18n/zh/posts/article/article4.md +0 -20
- package/template/zh-CN/.vuepress/config.ts +0 -28
- package/template/zh-CN/.vuepress/navbar.ts +0 -52
- package/template/zh-CN/.vuepress/public/favicon.ico +0 -0
- package/template/zh-CN/.vuepress/public/logo.png +0 -0
- package/template/zh-CN/.vuepress/public/logo.svg +0 -1
- package/template/zh-CN/.vuepress/sidebar.ts +0 -46
- package/template/zh-CN/.vuepress/styles/index.scss +0 -0
- package/template/zh-CN/.vuepress/styles/palette.scss +0 -0
- package/template/zh-CN/.vuepress/themeConfig.ts +0 -96
- package/template/zh-CN/README.md +0 -48
- package/template/zh-CN/guide/markdown.md +0 -339
- package/template/zh-CN/guide/page.md +0 -66
- package/template/zh-CN/home.md +0 -109
- package/template/zh-CN/posts/article/article1.md +0 -19
- package/template/zh-CN/posts/article/article3.md +0 -20
- package/template/zh-CN/posts/article/article5.md +0 -20
- package/template/zh-CN/posts/article/article6.md +0 -21
- package/template/zh-CN/posts/article/article7.md +0 -20
- package/template/zh-CN/posts/article/article8.md +0 -20
- package/template/zh-CN/posts/article10.md +0 -20
- package/template/zh-CN/posts/article11.md +0 -20
- package/template/zh-CN/posts/article12.md +0 -21
- package/template/zh-CN/posts/article9.md +0 -20
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -8
- /package/template/{i18n/zh/guide → blog/zh/demo}/encrypt.md +0 -0
- /package/template/{zh-CN/guide → docs/zh/demo}/encrypt.md +0 -0
- /package/template/{en-US/.vuepress/public → public}/favicon.ico +0 -0
- /package/template/{en-US/.vuepress/public → public}/logo.png +0 -0
- /package/template/{en-US/.vuepress/public → public}/logo.svg +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2020 - PRESENT by
|
|
3
|
+
Copyright (C) 2020 - PRESENT by Mr.Hope<mister-hope@outlook.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# create-vuepress-theme-hope
|
|
2
|
+
|
|
3
|
+
[ 
|
|
4
|
+
|
|
5
|
+
Create template shortcut for vuepress-theme-hope.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# npm
|
|
11
|
+
npm init vuepress-theme-hope <dir>
|
|
12
|
+
|
|
13
|
+
# yarn
|
|
14
|
+
yarn create vuepress-theme-hope <dir>
|
|
15
|
+
|
|
16
|
+
# pnpm
|
|
17
|
+
pnpm create vuepress-theme-hope <dir>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
快速创建 vuepress-theme-hope 模板捷径。
|
|
23
|
+
|
|
24
|
+
## 使用
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# npm
|
|
28
|
+
npm init vuepress-theme-hope <dir>
|
|
29
|
+
|
|
30
|
+
# yarn
|
|
31
|
+
yarn create vuepress-theme-hope <dir>
|
|
32
|
+
|
|
33
|
+
# pnpm
|
|
34
|
+
pnpm create vuepress-theme-hope <dir>
|
|
35
|
+
```
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{existsSync as h,readFileSync as $,writeFileSync as d,readdirSync as v,mkdirSync as N,statSync as k,createReadStream as E,createWriteStream as I}from"node:fs";import{resolve as n,join as b,dirname as j}from"node:path";import{cac as O}from"cac";import{execaCommandSync as l,execaCommand as z}from"execa";import p from"inquirer";import{createRequire as A}from"node:module";import{fileURLToPath as F}from"node:url";const W={简体中文:{flow:{getVersion:"获取依赖的最新版本...",createPackage:"生成 package.json...",updatePackage:"更新 package.json...",generateTemplate:"生成模板...",install:"安装依赖...",devServer:`启动开发服务器...
|
|
3
|
+
启动成功后,请在浏览器输入给出的开发服务器地址(默认为 'localhost:8080')`},question:{packageManager:"选择包管理器",i18n:"项目需要用到多语言么?",git:"是否初始化 Git 仓库?",workflow:"是否需要一个自动部署文档到 GitHub Pages 的工作流?",preset:"你想要创建什么类型的项目?",devServer:"是否想要现在启动 Demo 查看?",name:"设置应用名称",version:"设置应用版本号",description:"设置应用描述",license:"设置协议"},hint:{install:`这可能需要数分钟,请耐心等待.
|
|
4
|
+
我们无法正确输出子进程的进度条,所以进程可能会看似未响应`,finish:"模板已成功生成!",devServer:e=>`提示: 请使用 "${e} run docs:dev" 命令启动开发服务器`},error:{name:"应用名称应只包含小写字母、数字和连接线 (-)",version:"此版本无效,版本号应为 'x.x.x'",preset:"预设 (--preset) 仅支持 doc 或 blog",outputDirMissing:e=>`"[dir]" 的方括号表示此处为一个参数,你应该替换为自己想使用的文件夹名称,如 "my-blog", "project-docs" 等!
|
|
5
|
+
例如: "${e} init vuepress-theme-hope project-docs"`,updateDirMissing:e=>`"[dir]" 的方括号表示此处为一个参数,你应该替换为自己想使用的文件夹名称,如 "src", "docs" 等!
|
|
6
|
+
例如: "${e} init vuepress-theme-hope docs"`,dirNotEmpty:e=>`目标文件夹 "${e}" 不为空,请选择一个空文件夹或者手动删除文件夹中的文件`}},"english (US)":{flow:{getVersion:"Getting latest version of deps...",createPackage:"Generating package.json...",updatePackage:"Updating package.json...",generateTemplate:"Generating Template...",install:"Installing Deps...",devServer:`Staring dev server...
|
|
7
|
+
After the dev server starts running, please visit the given server link ('localhost:8080' by default)`},question:{i18n:"Does the project need multiple languages?",git:"Initialize a git repository?",workflow:"Do you need a GitHub workflow to deploy docs on GitHub pages?",preset:"What type of project do you want to create?",packageManager:"Choose package manager",devServer:"Would you like to preview template now?",name:"Your project name",version:"Your project version",description:"Your project description",license:"Your project license"},hint:{install:`This may take a few minutes, please be patient.
|
|
8
|
+
We can not correctly output progress bar from child process, so the process may look stuck.`,finish:"Successful Generated!",devServer:e=>`Hint: You should execute "${e} run docs:dev" to start dev server.`},error:{name:"package name should only contain lowercase characters, numbers and dash",version:"This version is not a valid one. Version should be like 'x.x.x'",preset:'preset (--preset) only support "doc" or "blog"',outputDirMissing:e=>`The brackets in "[dir]" means it is an argument, you should replace it with folder name you want to use! E.g.: "my-blog", "project-docs"
|
|
9
|
+
For example: "${e} init vuepress-theme-hope project-docs"`,updateDirMissing:e=>`The brackets in "[dir]" means it is an argument, you should replace it with folder name you want to use! E.g.: "src", "docs"
|
|
10
|
+
For example: "${e} init vuepress-theme-hope docs"`,dirNotEmpty:e=>`Target folder "${e}" is not empty, please choose an empty folder or delete files in it.`}}},H=async()=>{const{language:e}=await p.prompt([{name:"language",type:"list",message:"Select a language to display / 选择显示语言",choices:["english (US)","简体中文"]}]);return{lang:e,message:W[e]}},J=e=>`
|
|
11
|
+
node_modules/
|
|
12
|
+
${e}/.vuepress/.cache/
|
|
13
|
+
${e}/.vuepress/.temp/
|
|
14
|
+
${e}/.vuepress/dist/
|
|
15
|
+
`,S=(e,t=process.cwd())=>{const s=n(t,".gitignore"),o=h(s)?$(s,{encoding:"utf-8"}):"";d(s,`${o}${J(e)}`,{encoding:"utf-8"})},R=(e,t,s)=>`
|
|
16
|
+
name: ${s==="简体中文"?"部署文档":"Deploy Docs"}
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
push:
|
|
20
|
+
branches:
|
|
21
|
+
# ${s==="简体中文"?"确保这是你正在使用的分支名称":"make sure this is the branch you are using"}
|
|
22
|
+
- main
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
deploy-gh-pages:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout
|
|
29
|
+
uses: actions/checkout@v3
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
# ${s==="简体中文"?"如果你文档需要 Git 子模块,取消注释下一行":"if your docs needs submodules, uncomment the following line"}
|
|
33
|
+
# submodules: true
|
|
34
|
+
|
|
35
|
+
${e==="pnpm"?` - name: ${s==="简体中文"?"安装 pnpm":"Install pnpm"}
|
|
36
|
+
uses: pnpm/action-setup@v2
|
|
37
|
+
with:
|
|
38
|
+
version: 8
|
|
39
|
+
run_install: true
|
|
40
|
+
`:""}
|
|
41
|
+
|
|
42
|
+
- name: ${s==="简体中文"?"设置 Node.js":"Setup Node.js"}
|
|
43
|
+
uses: actions/setup-node@v3
|
|
44
|
+
with:
|
|
45
|
+
node-version: 18
|
|
46
|
+
cache: ${e}
|
|
47
|
+
|
|
48
|
+
${e!=="pnpm"?` - name: ${s==="简体中文"?"安装依赖":"Install Deps"}
|
|
49
|
+
run: ${e==="npm"?"npm ci":`${e} install --frozen-lockfile`}
|
|
50
|
+
`:""}
|
|
51
|
+
- name: ${s==="简体中文"?"构建文档":"Build Docs"}
|
|
52
|
+
env:
|
|
53
|
+
NODE_OPTIONS: --max_old_space_size=8192
|
|
54
|
+
run: |-
|
|
55
|
+
${e} run docs:build
|
|
56
|
+
> ${b(t,".vuepress/dist/.nojekyll").replace(/\\/g,"/")}
|
|
57
|
+
|
|
58
|
+
- name: ${s==="简体中文"?"部署文档":"Deploy Docs"}
|
|
59
|
+
uses: JamesIves/github-pages-deploy-action@v4
|
|
60
|
+
with:
|
|
61
|
+
# ${s==="简体中文"?"这是文档部署到的分支名称":"This is the branch where the docs are deployed to"}
|
|
62
|
+
branch: gh-pages
|
|
63
|
+
folder: ${b(t,".vuepress/dist").replace(/\\/g,"/")}
|
|
64
|
+
`,Y=Array.isArray,y=e=>Object.prototype.toString.call(e)==="[object Object]",f=(e,...t)=>{if(t.length===0)return e;const s=t.shift()||null;return s&&Object.entries(s).forEach(([o,a])=>{o==="__proto__"||o==="constructor"||(y(e[o])&&y(a)?f(e[o],a):Y(a)?e[o]=[...a]:y(a)?e[o]={...a}:e[o]=s[o])}),f(e,...t)},m=e=>{try{v(e)}catch{try{N(e,{recursive:!0})}catch{}}},x=(e,t)=>{const s=j(t);m(s);const o=E(e),a=I(t);o.pipe(a)},D=(e,t)=>{m(t),v(e,{withFileTypes:!0}).forEach(s=>{s.isFile()?x(`${e}/${s.name}`,`${t}/${s.name}`):s.isDirectory()&&D(`${e}/${s.name}`,`${t}/${s.name}`)})},M=(e,t)=>{k(e).isDirectory()?D(e,t):k(e).isFile()&&x(e,t)},U=(e=process.cwd())=>{try{return l("git status",{cwd:e}),!0}catch{return!1}},V=()=>{try{return l("git --version"),!0}catch{return!1}},L=()=>{try{return l("pnpm --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},B=()=>{try{return l("yarn --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},w=["npm"];B()&&w.push("yarn"),L()&&w.push("pnpm");const K=async e=>(await p.prompt([{name:"packageManager",type:"list",message:e,choices:w}])).packageManager,Q=F(import.meta.url),T=j(Q),G=async(e,{cwd:t=process.cwd(),packageManager:s,lang:o,message:a,preset:r})=>{const{workflow:c}=await p.prompt([{name:"workflow",type:"confirm",message:a.question.workflow,default:!0}]);if(r||(r=(await p.prompt([{name:"preset",type:"list",message:a.question.preset,choices:["blog","docs"]}])).preset),console.log(a.flow.generateTemplate),M(n(T,"../template/public"),n(t,e,"./.vuepress/public")),M(n(T,"../template",r),n(t,e)),c){const i=n(t,".github/workflows");m(i),d(n(i,"deploy-docs.yml"),R(s,e,o),{encoding:"utf-8"})}if(U(t))S(e,t);else if(V()){const{git:i}=await p.prompt([{name:"git",type:"confirm",message:a.question.git,default:!0}]);i&&(l("git init",{cwd:t}),S(e,t))}},q=A(import.meta.url)("create-vuepress-theme-hope/package.json").version,X=(e,t)=>({"docs:build":`vuepress build ${t}`,"docs:clean-dev":`vuepress dev ${t} --clean-cache`,"docs:dev":`vuepress dev ${t}`,"docs:update-package":`${e==="npm"?"npx":`${e} dlx`} vp-update`}),_=async(e,t,s,o=process.cwd())=>{const a=n(o,"package.json"),r=X(e,s),c={"@vuepress/client":"2.0.0-beta.61",vue:"^3.2.47",vuepress:"2.0.0-beta.61","vuepress-theme-hope":q};if(h(a)){console.log(t.flow.updatePackage);const i=JSON.parse($(a,{encoding:"utf-8"}));f(i,{scripts:r,devDependencies:c}),d(a,`${JSON.stringify(i,null,2)}
|
|
65
|
+
`,{encoding:"utf-8"})}else{console.log(t.flow.createPackage);const i={...await p.prompt([{name:"name",type:"input",message:t.question.name,default:"vuepress-theme-hope-template",validate:g=>/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u.exec(g)?!0:t.error.name},{name:"version",type:"input",message:t.question.version,default:"2.0.0",validate:g=>/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u.exec(g)?!0:t.error.version},{name:"description",type:"input",message:t.question.description,default:"A project of vuepress-theme-hope"},{name:"license",type:"input",message:t.question.license,default:"MIT"}]),type:"module",scripts:r,devDependencies:c};d(a,`${JSON.stringify(i,null,2)}
|
|
66
|
+
`,{encoding:"utf-8"})}},Z="https://registry.npmmirror.com/",ee=e=>l(`${e} config get registry`).stdout,te=async(e,t)=>{const s=ee(e);if(t==="简体中文"){const{registry:o}=await p.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return o==="国内镜像源"?Z:s}return s},P=async(e,t)=>{if(!e)return u.outputHelp();const{lang:s,message:o}=await H();if(t&&!["docs","blog"].includes(t))return console.log(o.error.preset);const a=await K(o.question.packageManager);if(e.startsWith("[")&&e.endsWith("]"))return console.log(o.error.updateDirMissing(a));const r=n(process.cwd(),e);return h(r)&&v(r).length?console.error(o.error.dirNotEmpty(e)):(m(r),{lang:s,message:o,packageManager:a})},C=async({cwd:e=process.cwd(),lang:t,message:s,packageManager:o})=>{const a=o==="pnpm"?"":await te(o,t);console.log(s.flow.install),console.warn(s.hint.install),l(`${o} install ${a?`--registry ${a}`:""}`,{cwd:e,stdout:"inherit"}),console.log(s.hint.finish);const{choice:r}=await p.prompt([{name:"choice",type:"confirm",message:s.question.devServer,default:!0}]);r?(console.log(s.flow.devServer),await z(`${o} run docs:dev`,{cwd:e,stdout:"inherit"})):console.log(s.hint.devServer(o))},u=O("vuepress-theme-hope");u.command("[dir]","Generate a new vuepress-theme-hope project").option("-p, --preset <preset>","Choose preset to use").usage("pnpm create vuepress-theme-hope [dir] / yarn create vuepress-theme-hope [dir] / npm init vuepress-theme-hope [dir]").example("docs").action(async(e,{preset:t=null})=>{const s=n(process.cwd(),e),o=await P(e,t);if(o){const{lang:a,message:r,packageManager:c}=o;await _(c,r,"src",e),await G("src",{cwd:s,packageManager:c,lang:a,message:r,preset:t}),await C({cwd:s,lang:a,message:r,packageManager:c})}}),u.command("add [dir]","Add vuepress template to dir").alias("inject").option("-p, --preset <preset>","Choose preset to use").usage("pnpm create vuepress-theme-hope add [dir] / yarn create vuepress-theme-hope add [dir] / npm init vuepress-theme-hope add [dir]").example("docs").action(async(e,{preset:t=null})=>{const s=await P(e,t);if(s){const{lang:o,message:a,packageManager:r}=s;await _(r,a,e),await G(e,{packageManager:r,lang:o,message:a,preset:t}),await C({message:a,lang:o,packageManager:r})}}),u.help(()=>[{title:"pnpm create vuepress-theme-hope [dir] / yarn create vuepress-theme-hope [dir] / npm init vuepress-theme-hope [dir]",body:"Create a vuepress-theme-hope template in [dir]"},{title:"pnpm create vuepress-theme-hope inject [dir] / yarn create vuepress-theme-hope add [dir] / npm init vuepress-theme-hope inject [dir]",body:"Add vuepress-theme-hope template in [dir] under current project"}]),u.version(q),u.parse();
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vuepress-theme-hope",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.201",
|
|
4
4
|
"description": "Create vuepress-theme-hope demo project helper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create",
|
|
7
7
|
"vuepress",
|
|
8
|
+
"vuepress2",
|
|
9
|
+
"vuepress-theme",
|
|
8
10
|
"vuepress-theme-hope"
|
|
9
11
|
],
|
|
10
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://theme-hope.vuejs.press/",
|
|
11
13
|
"bugs": {
|
|
12
14
|
"url": "https://github.com/vuepress-theme-hope/vuepress-theme-hope/issues"
|
|
13
15
|
},
|
|
@@ -22,20 +24,29 @@
|
|
|
22
24
|
"email": "mister-hope@outlook.com",
|
|
23
25
|
"url": "https://mrhope.site"
|
|
24
26
|
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
25
31
|
"bin": {
|
|
26
|
-
"create-vuepress-theme-hope": "./lib/
|
|
32
|
+
"create-vuepress-theme-hope": "./lib/index.js"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"lib",
|
|
36
|
+
"template"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"cac": "6.7.14",
|
|
40
|
+
"execa": "7.1.1",
|
|
41
|
+
"inquirer": "9.1.5"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/inquirer": "9.0.3"
|
|
27
45
|
},
|
|
28
46
|
"scripts": {
|
|
29
|
-
"build": "rollup -c",
|
|
47
|
+
"build": "rollup -c rollup.config.ts --configPlugin esbuild",
|
|
30
48
|
"clean": "rimraf ./lib ./*.tsbuildinfo",
|
|
31
|
-
"dev": "
|
|
49
|
+
"dev": "pnpm dev:ts",
|
|
32
50
|
"dev:ts": "tsc -b tsconfig.build.json --watch"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
"@types/inquirer": "^8.2.0",
|
|
36
|
-
"cac": "^6.7.12",
|
|
37
|
-
"execa": "^5.1.1",
|
|
38
|
-
"inquirer": "^8.2.1"
|
|
39
|
-
},
|
|
40
|
-
"gitHead": "01d17df3dde7be372be6c9b67356049590ca7aec"
|
|
41
|
-
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineUserConfig } from "vuepress";
|
|
2
|
+
import theme from "./theme.js";
|
|
3
|
+
|
|
4
|
+
export default defineUserConfig({
|
|
5
|
+
base: "/",
|
|
6
|
+
|
|
7
|
+
locales: {
|
|
8
|
+
"/": {
|
|
9
|
+
lang: "en-US",
|
|
10
|
+
title: "Blog Demo",
|
|
11
|
+
description: "A blog demo for vuepress-theme-hope",
|
|
12
|
+
},
|
|
13
|
+
"/zh/": {
|
|
14
|
+
lang: "zh-CN",
|
|
15
|
+
title: "博客演示",
|
|
16
|
+
description: "vuepress-theme-hope 的博客演示",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
theme,
|
|
21
|
+
|
|
22
|
+
// Enable it with pwa
|
|
23
|
+
// shouldPrefetch: false,
|
|
24
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { navbar } from "vuepress-theme-hope";
|
|
2
|
+
|
|
3
|
+
export const enNavbar = navbar([
|
|
4
|
+
"/",
|
|
5
|
+
{ text: "Demo", icon: "discover", link: "/demo/" },
|
|
6
|
+
{
|
|
7
|
+
text: "Posts",
|
|
8
|
+
icon: "edit",
|
|
9
|
+
prefix: "/posts/",
|
|
10
|
+
children: [
|
|
11
|
+
{
|
|
12
|
+
text: "Apple",
|
|
13
|
+
icon: "edit",
|
|
14
|
+
prefix: "apple/",
|
|
15
|
+
children: [
|
|
16
|
+
{ text: "Apple1", icon: "edit", link: "1" },
|
|
17
|
+
{ text: "Apple2", icon: "edit", link: "2" },
|
|
18
|
+
"3",
|
|
19
|
+
"4",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
text: "Banana",
|
|
24
|
+
icon: "edit",
|
|
25
|
+
prefix: "banana/",
|
|
26
|
+
children: [
|
|
27
|
+
{
|
|
28
|
+
text: "Banana 1",
|
|
29
|
+
icon: "edit",
|
|
30
|
+
link: "1",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
text: "Banana 2",
|
|
34
|
+
icon: "edit",
|
|
35
|
+
link: "2",
|
|
36
|
+
},
|
|
37
|
+
"3",
|
|
38
|
+
"4",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{ text: "Cherry", icon: "edit", link: "cherry" },
|
|
42
|
+
{ text: "Dragon Fruit", icon: "edit", link: "dragonfruit" },
|
|
43
|
+
"tomato",
|
|
44
|
+
"strawberry",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
text: "V2 Docs",
|
|
49
|
+
icon: "note",
|
|
50
|
+
link: "https://theme-hope.vuejs.press/",
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { navbar } from "vuepress-theme-hope";
|
|
2
|
+
|
|
3
|
+
export const zhNavbar = navbar([
|
|
4
|
+
"/zh/",
|
|
5
|
+
{ text: "演示", icon: "discover", link: "/zh/demo/" },
|
|
6
|
+
{
|
|
7
|
+
text: "博文",
|
|
8
|
+
icon: "edit",
|
|
9
|
+
prefix: "/zh/posts/",
|
|
10
|
+
children: [
|
|
11
|
+
{
|
|
12
|
+
text: "苹果",
|
|
13
|
+
icon: "edit",
|
|
14
|
+
prefix: "apple/",
|
|
15
|
+
children: [
|
|
16
|
+
{ text: "苹果1", icon: "edit", link: "1" },
|
|
17
|
+
{ text: "苹果2", icon: "edit", link: "2" },
|
|
18
|
+
"3",
|
|
19
|
+
"4",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
text: "香蕉",
|
|
24
|
+
icon: "edit",
|
|
25
|
+
prefix: "banana/",
|
|
26
|
+
children: [
|
|
27
|
+
{
|
|
28
|
+
text: "香蕉 1",
|
|
29
|
+
icon: "edit",
|
|
30
|
+
link: "1",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
text: "香蕉 2",
|
|
34
|
+
icon: "edit",
|
|
35
|
+
link: "2",
|
|
36
|
+
},
|
|
37
|
+
"3",
|
|
38
|
+
"4",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{ text: "樱桃", icon: "edit", link: "cherry" },
|
|
42
|
+
{ text: "火龙果", icon: "edit", link: "dragonfruit" },
|
|
43
|
+
"tomato",
|
|
44
|
+
"strawberry",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
text: "V2 文档",
|
|
49
|
+
icon: "note",
|
|
50
|
+
link: "https://theme-hope.vuejs.press/zh/",
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { sidebar } from "vuepress-theme-hope";
|
|
2
|
+
|
|
3
|
+
export const enSidebar = sidebar({
|
|
4
|
+
"/": [
|
|
5
|
+
"",
|
|
6
|
+
{
|
|
7
|
+
icon: "discover",
|
|
8
|
+
text: "Demo",
|
|
9
|
+
prefix: "demo/",
|
|
10
|
+
link: "demo/",
|
|
11
|
+
children: "structure",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
text: "Articles",
|
|
15
|
+
icon: "note",
|
|
16
|
+
prefix: "posts/",
|
|
17
|
+
children: "structure",
|
|
18
|
+
},
|
|
19
|
+
"intro",
|
|
20
|
+
"slides",
|
|
21
|
+
],
|
|
22
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { sidebar } from "vuepress-theme-hope";
|
|
2
|
+
|
|
3
|
+
export const zhSidebar = sidebar({
|
|
4
|
+
"/zh/": [
|
|
5
|
+
"",
|
|
6
|
+
{
|
|
7
|
+
text: "如何使用",
|
|
8
|
+
icon: "creative",
|
|
9
|
+
prefix: "demo/",
|
|
10
|
+
link: "demo/",
|
|
11
|
+
children: "structure",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
text: "文章",
|
|
15
|
+
icon: "note",
|
|
16
|
+
prefix: "posts/",
|
|
17
|
+
children: "structure",
|
|
18
|
+
},
|
|
19
|
+
"intro",
|
|
20
|
+
"slides",
|
|
21
|
+
],
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// place your custom styles here
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { hopeTheme } from "vuepress-theme-hope";
|
|
2
|
+
import { enNavbar, zhNavbar } from "./navbar/index.js";
|
|
3
|
+
import { enSidebar, zhSidebar } from "./sidebar/index.js";
|
|
4
|
+
|
|
5
|
+
const MR_HOPE_AVATAR =
|
|
6
|
+
'<svg viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient gradientTransform="matrix(.2478 .78133 -2.54797 .63622 910.35 281.58)" gradientUnits="userSpaceOnUse" id="a" x1="37.827" x2="159.988" y1="272.916" y2="274.63"><stop offset=".75" stop-color="#e33939"/><stop offset=".998" stop-color="#fff"/></linearGradient><linearGradient gradientTransform="matrix(.13814 .80797 2.55599 -.6032 34.087 494.369)" gradientUnits="userSpaceOnUse" id="b" x1="37.827" x2="159.988" y1="272.916" y2="274.63"><stop offset=".815" stop-color="#e33939"/><stop offset="1" stop-color="#fff"/></linearGradient></defs><path d="M135.637 588.067c-48.891-201.334 74.605-404.162 275.837-453.028 201.233-48.866 403.998 74.734 452.889 276.068 48.892 201.335-74.606 404.162-275.838 453.029-201.233 48.866-403.997-74.734-452.888-276.069Z" fill="#fde68a" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="10"/><path d="M596.076 197.044c-3.342-56.09 56.897-77.831 89.017-51.361m-410.65 128.819c-22.753-51.377-86.256-43.07-102.659-4.816" fill="none" stroke="#6d5e56" stroke-linecap="round" stroke-linejoin="round" stroke-width="11"/><path d="M833.568 288.02c.05 18.046-12.584 30.699-21.346 32.211-8.762 1.512-17.031-1.099-18.584-1.341 0 0-61.363-6.103-105.627 6.921-44.265 13.026-87.04 47.387-94.637 51.892-6.627 3.928-29.112 7.697-44.462-12.938-15.351-20.636.024-41.526.024-41.526s12.685-18.279 40.771-35.123c28.088-16.844 24.624-13.226 52.326-25.696 15.247-6.865 43.319-14.186 67.429-17.069 25.193-3.011 46.348-1.384 57.673.769 22.165 4.212 28.632 5.93 39.169 9.229 12.451 3.898 27.214 14.516 27.264 32.671Z" fill="#fff" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"/><path d="M558.351 345.632c-3.458-14.237 5.214-28.566 19.367-32.003 14.154-3.437 28.43 5.32 31.887 19.557 3.458 14.238-5.212 28.567-19.367 32.004-14.152 3.437-28.43-5.319-31.887-19.558Z" fill="#6d5e56" fill-rule="evenodd" stroke="#6d5e56" stroke-linecap="round" stroke-linejoin="round" stroke-width="6.268"/><path d="M220.249 483.416c46.81-11.689 91.323-.467 99.42 25.064 8.098 25.532-23.286 55.706-70.097 67.393-46.811 11.689-91.323.467-99.42-25.064-8.097-25.532 23.286-55.706 70.097-67.393Z" fill="url(#a)" fill-rule="evenodd" opacity=".261"/><path d="M739.9 357.226c-46.959 11.082-81.367 41.469-76.853 67.871 4.514 26.402 46.241 38.821 93.198 27.738 46.958-11.081 81.366-41.467 76.853-67.869-4.514-26.403-46.241-38.821-93.198-27.74Z" fill="url(#b)" fill-rule="evenodd" opacity=".261"/><path d="M400.934 398.917c-.599 18.034-13.681 30.218-22.494 31.409-8.812 1.192-16.982-1.716-18.526-2.014 0 0-61.109-8.334-105.819 3.07-44.709 11.404-88.696 44.181-96.452 48.406-6.763 3.683-29.372 6.632-43.972-14.546-14.6-21.18 1.519-41.494 1.519-41.494s13.335-17.803 42.013-33.612c28.677-15.809 25.085-12.319 53.222-23.772 15.484-6.304 43.803-12.598 68.005-14.6 25.288-2.093 46.373.305 57.616 2.867 22 5.016 28.401 6.968 38.813 10.649 12.304 4.348 26.677 15.496 26.075 33.637Z" fill="#fff" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"/><path d="M129.05 445.546c-3.458-14.239 5.213-28.566 19.367-32.003 14.153-3.437 28.429 5.318 31.887 19.557 3.458 14.238-5.213 28.566-19.367 32.003-14.153 3.437-28.43-5.318-31.887-19.557Z" fill="#6d5e56" fill-rule="evenodd" stroke="#6d5e56" stroke-linecap="round" stroke-linejoin="round" stroke-width="6.268"/><path d="M424.381 696.386s64.427 13.646 101.996 5.757C640.653 678.146 690.8 521.894 690.8 521.894" fill="none" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="11"/><path d="M796.04 666.774s-10.734-44.165-41.405-11.348c-9.681 10.359-10.438 40.604-28.217 81.89-15.942 37.02-39.564 60.728-42.938 76.063-3.374 15.335.451 35.992 26.352 41.537 25.902 5.545 41.967-23.381 41.967-23.381l44.241-164.761Z" fill="#fde68a" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="10"/><path d="M793.337 664.734c-37.075 160.045-51.73 163.145-40.343 184.845 11.387 21.701 51.417 33.716 71.876-7.313 6.734-13.505-1.31-43.317-1.511-78.077-.307-53.06 16.865-86.111 10.403-98.1-15.332-28.452-39.377-5.875-40.425-1.355Z" fill="#fde68a" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="10"/></svg>';
|
|
7
|
+
|
|
8
|
+
export default hopeTheme({
|
|
9
|
+
hostname: "https://mister-hope.github.io",
|
|
10
|
+
|
|
11
|
+
author: {
|
|
12
|
+
name: "Mr.Hope",
|
|
13
|
+
url: "https://mrhope.site",
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
iconAssets: "iconfont",
|
|
17
|
+
|
|
18
|
+
logo: "/logo.svg",
|
|
19
|
+
|
|
20
|
+
repo: "vuepress-theme-hope/vuepress-theme-hope",
|
|
21
|
+
|
|
22
|
+
docsDir: "docs",
|
|
23
|
+
|
|
24
|
+
blog: {
|
|
25
|
+
medias: {
|
|
26
|
+
Baidu: "https://example.com",
|
|
27
|
+
BiliBili: "https://example.com",
|
|
28
|
+
Bitbucket: "https://example.com",
|
|
29
|
+
Dingding: "https://example.com",
|
|
30
|
+
Discord: "https://example.com",
|
|
31
|
+
Dribbble: "https://example.com",
|
|
32
|
+
Email: "mailto:info@example.com",
|
|
33
|
+
Evernote: "https://example.com",
|
|
34
|
+
Facebook: "https://example.com",
|
|
35
|
+
Flipboard: "https://example.com",
|
|
36
|
+
Gitee: "https://example.com",
|
|
37
|
+
GitHub: "https://example.com",
|
|
38
|
+
Gitlab: "https://example.com",
|
|
39
|
+
Gmail: "mailto:info@example.com",
|
|
40
|
+
Instagram: "https://example.com",
|
|
41
|
+
Lark: "https://example.com",
|
|
42
|
+
Lines: "https://example.com",
|
|
43
|
+
Linkedin: "https://example.com",
|
|
44
|
+
Pinterest: "https://example.com",
|
|
45
|
+
Pocket: "https://example.com",
|
|
46
|
+
QQ: "https://example.com",
|
|
47
|
+
Qzone: "https://example.com",
|
|
48
|
+
Reddit: "https://example.com",
|
|
49
|
+
Rss: "https://example.com",
|
|
50
|
+
Steam: "https://example.com",
|
|
51
|
+
Twitter: "https://example.com",
|
|
52
|
+
Wechat: "https://example.com",
|
|
53
|
+
Weibo: "https://example.com",
|
|
54
|
+
Whatsapp: "https://example.com",
|
|
55
|
+
Youtube: "https://example.com",
|
|
56
|
+
Zhihu: "https://example.com",
|
|
57
|
+
MrHope: ["https://mrhope.site", MR_HOPE_AVATAR],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
locales: {
|
|
62
|
+
"/": {
|
|
63
|
+
// navbar
|
|
64
|
+
navbar: enNavbar,
|
|
65
|
+
|
|
66
|
+
// sidebar
|
|
67
|
+
sidebar: enSidebar,
|
|
68
|
+
|
|
69
|
+
footer: "Default footer",
|
|
70
|
+
|
|
71
|
+
displayFooter: true,
|
|
72
|
+
|
|
73
|
+
blog: {
|
|
74
|
+
description: "A FrontEnd programmer",
|
|
75
|
+
intro: "/intro.html",
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
metaLocales: {
|
|
79
|
+
editLink: "Edit this page on GitHub",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Chinese locale config
|
|
85
|
+
*/
|
|
86
|
+
"/zh/": {
|
|
87
|
+
// navbar
|
|
88
|
+
navbar: zhNavbar,
|
|
89
|
+
|
|
90
|
+
// sidebar
|
|
91
|
+
sidebar: zhSidebar,
|
|
92
|
+
|
|
93
|
+
footer: "默认页脚",
|
|
94
|
+
|
|
95
|
+
displayFooter: true,
|
|
96
|
+
|
|
97
|
+
blog: {
|
|
98
|
+
description: "一个前端开发者",
|
|
99
|
+
intro: "/zh/intro.html",
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
// page meta
|
|
103
|
+
metaLocales: {
|
|
104
|
+
editLink: "在 GitHub 上编辑此页",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
encrypt: {
|
|
110
|
+
config: {
|
|
111
|
+
"/demo/encrypt.html": ["1234"],
|
|
112
|
+
"/zh/demo/encrypt.html": ["1234"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
plugins: {
|
|
117
|
+
blog: true,
|
|
118
|
+
|
|
119
|
+
comment: {
|
|
120
|
+
// @ts-expect-error: You should generate and use your own comment service
|
|
121
|
+
provider: "Giscus",
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
// all features are enabled for demo, only preserve features you need here
|
|
125
|
+
mdEnhance: {
|
|
126
|
+
align: true,
|
|
127
|
+
attrs: true,
|
|
128
|
+
chart: true,
|
|
129
|
+
codetabs: true,
|
|
130
|
+
demo: true,
|
|
131
|
+
echarts: true,
|
|
132
|
+
figure: true,
|
|
133
|
+
flowchart: true,
|
|
134
|
+
gfm: true,
|
|
135
|
+
imgLazyload: true,
|
|
136
|
+
imgSize: true,
|
|
137
|
+
include: true,
|
|
138
|
+
katex: true,
|
|
139
|
+
mark: true,
|
|
140
|
+
mermaid: true,
|
|
141
|
+
playground: {
|
|
142
|
+
presets: ["ts", "vue"],
|
|
143
|
+
},
|
|
144
|
+
presentation: {
|
|
145
|
+
plugins: ["highlight", "math", "search", "notes", "zoom"],
|
|
146
|
+
},
|
|
147
|
+
stylize: [
|
|
148
|
+
{
|
|
149
|
+
matcher: "Recommended",
|
|
150
|
+
replacer: ({ tag }) => {
|
|
151
|
+
if (tag === "em")
|
|
152
|
+
return {
|
|
153
|
+
tag: "Badge",
|
|
154
|
+
attrs: { type: "tip" },
|
|
155
|
+
content: "Recommended",
|
|
156
|
+
};
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
sub: true,
|
|
161
|
+
sup: true,
|
|
162
|
+
tabs: true,
|
|
163
|
+
vPre: true,
|
|
164
|
+
vuePlayground: true,
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
// uncomment these if you want a PWA
|
|
168
|
+
// pwa: {
|
|
169
|
+
// favicon: "/favicon.ico",
|
|
170
|
+
// cacheHTML: true,
|
|
171
|
+
// cachePic: true,
|
|
172
|
+
// appendBase: true,
|
|
173
|
+
// apple: {
|
|
174
|
+
// icon: "/assets/icon/apple-icon-152.png",
|
|
175
|
+
// statusBarColor: "black",
|
|
176
|
+
// },
|
|
177
|
+
// msTile: {
|
|
178
|
+
// image: "/assets/icon/ms-icon-144.png",
|
|
179
|
+
// color: "#ffffff",
|
|
180
|
+
// },
|
|
181
|
+
// manifest: {
|
|
182
|
+
// icons: [
|
|
183
|
+
// {
|
|
184
|
+
// src: "/assets/icon/chrome-mask-512.png",
|
|
185
|
+
// sizes: "512x512",
|
|
186
|
+
// purpose: "maskable",
|
|
187
|
+
// type: "image/png",
|
|
188
|
+
// },
|
|
189
|
+
// {
|
|
190
|
+
// src: "/assets/icon/chrome-mask-192.png",
|
|
191
|
+
// sizes: "192x192",
|
|
192
|
+
// purpose: "maskable",
|
|
193
|
+
// type: "image/png",
|
|
194
|
+
// },
|
|
195
|
+
// {
|
|
196
|
+
// src: "/assets/icon/chrome-512.png",
|
|
197
|
+
// sizes: "512x512",
|
|
198
|
+
// type: "image/png",
|
|
199
|
+
// },
|
|
200
|
+
// {
|
|
201
|
+
// src: "/assets/icon/chrome-192.png",
|
|
202
|
+
// sizes: "192x192",
|
|
203
|
+
// type: "image/png",
|
|
204
|
+
// },
|
|
205
|
+
// ],
|
|
206
|
+
// shortcuts: [
|
|
207
|
+
// {
|
|
208
|
+
// name: "Demo",
|
|
209
|
+
// short_name: "Demo",
|
|
210
|
+
// url: "/demo/",
|
|
211
|
+
// icons: [
|
|
212
|
+
// {
|
|
213
|
+
// src: "/assets/icon/guide-maskable.png",
|
|
214
|
+
// sizes: "192x192",
|
|
215
|
+
// purpose: "maskable",
|
|
216
|
+
// type: "image/png",
|
|
217
|
+
// },
|
|
218
|
+
// ],
|
|
219
|
+
// },
|
|
220
|
+
// ],
|
|
221
|
+
// },
|
|
222
|
+
// },
|
|
223
|
+
},
|
|
224
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
home: true
|
|
3
|
-
layout:
|
|
3
|
+
layout: BlogHome
|
|
4
4
|
icon: home
|
|
5
5
|
title: Blog Home
|
|
6
6
|
heroImage: /logo.svg
|
|
7
|
-
heroText:
|
|
7
|
+
heroText: The name of your blog
|
|
8
8
|
tagline: You can put your slogan here
|
|
9
9
|
heroFullScreen: true
|
|
10
10
|
projects:
|
|
@@ -41,8 +41,8 @@ projects:
|
|
|
41
41
|
footer: customize your footer text
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
This is a blog home page.
|
|
44
|
+
This is a blog home page demo.
|
|
45
45
|
|
|
46
|
-
To use this layout, you should set both `layout:
|
|
46
|
+
To use this layout, you should set both `layout: BlogHome` and `home: true` in the page front matter.
|
|
47
47
|
|
|
48
|
-
For related configuration docs, please see [blog homepage](https://
|
|
48
|
+
For related configuration docs, please see [blog homepage](https://theme-hope.vuejs.press/guide/blog/home/).
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
---
|
|
2
|
+
title: Features Demo
|
|
2
3
|
index: false
|
|
3
|
-
icon:
|
|
4
|
+
icon: discover
|
|
4
5
|
category:
|
|
5
6
|
- Guide
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- [Page Config](page.md)
|
|
9
|
+
## Catalog
|
|
11
10
|
|
|
12
11
|
- [Markdown Enhance](markdown.md)
|
|
13
12
|
|
|
13
|
+
- [Page Config](page.md)
|
|
14
|
+
|
|
14
15
|
- [Function Disable](disable.md)
|
|
15
16
|
|
|
16
17
|
- [Encryption Demo](encrypt.md)
|