create-vuepress-theme-hope 2.0.0-beta.16 → 2.0.0-beta.160
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 → README.md} +0 -0
- package/lib/index.js +66 -0
- package/package.json +24 -14
- package/template/blog/.vuepress/config.ts +23 -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 +246 -0
- package/template/{i18n → blog}/README.md +4 -4
- 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 +408 -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} +7 -7
- 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/{i18n/zh/guide → blog/zh/demo}/encrypt.md +0 -0
- package/template/blog/zh/demo/markdown.md +388 -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 +23 -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 +194 -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 +408 -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} +7 -7
- package/template/{i18n/zh/home.md → docs/zh/README.md} +25 -25
- 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/{zh-CN/guide → docs/zh/demo}/encrypt.md +0 -0
- package/template/docs/zh/demo/markdown.md +388 -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/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/CHANGELOG.md +0 -164
- package/lib/node/index.d.ts +0 -1
- package/lib/node/index.js +0 -3
- package/lib/node/index.js.map +0 -1
- 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/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 → README.md}
RENAMED
|
File without changes
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{existsSync as g,readFileSync as w,writeFileSync as d,readdirSync as h,mkdirSync as C,statSync as k,createReadStream as N,createWriteStream as E}from"node:fs";import{resolve as a,join as $,dirname as b}from"node:path";import{cac as I}from"cac";import{execaCommandSync as l,execaCommand as O}from"execa";import p from"inquirer";import{fileURLToPath as z}from"node:url";import"node:https";import{createRequire as A}from"node:module";const F={简体中文:{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@next project-docs"`,updateDirMissing:e=>`"[dir]" 的方括号表示此处为一个参数,你应该替换为自己想使用的文件夹名称,如 "src", "docs" 等!
|
|
6
|
+
例如: "${e} init vuepress-theme-hope@next 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@next 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@next docs"`,dirNotEmpty:e=>`Target folder "${e}" is not empty, please choose an empty folder or delete files in it.`}}},W=async()=>{const{language:e}=await p.prompt([{name:"language",type:"list",message:"Select a language to display / 选择显示语言",choices:["english (US)","简体中文"]}]);return{lang:e,message:F[e]}},H=e=>`
|
|
11
|
+
node_modules/
|
|
12
|
+
${e}/.vuepress/.cache/
|
|
13
|
+
${e}/.vuepress/.temp/
|
|
14
|
+
${e}/.vuepress/dist/
|
|
15
|
+
`,x=(e,s=process.cwd())=>{const t=a(s,".gitignore"),r=g(t)?w(t,{encoding:"utf-8"}):"";d(t,`${r}${H(e)}`,{encoding:"utf-8"})},J=(e,s,t)=>`
|
|
16
|
+
name: ${t==="简体中文"?"部署文档":"Deploy Docs"}
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
push:
|
|
20
|
+
branches:
|
|
21
|
+
# ${t==="简体中文"?"确保这是你正在使用的分支名称":"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
|
+
# ${t==="简体中文"?"如果你文档需要 Git 子模块,取消注释下一行":"if your docs needs submodules, uncomment the following line"}
|
|
33
|
+
# submodules: true
|
|
34
|
+
|
|
35
|
+
${e==="pnpm"?` - name: ${t==="简体中文"?"安装 pnpm":"Install pnpm"}
|
|
36
|
+
uses: pnpm/action-setup@v2
|
|
37
|
+
with:
|
|
38
|
+
version: 7
|
|
39
|
+
run_install: true
|
|
40
|
+
`:""}
|
|
41
|
+
|
|
42
|
+
- name: ${t==="简体中文"?"设置 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: ${t==="简体中文"?"安装依赖":"Install Deps"}
|
|
49
|
+
run: ${e==="npm"?"npm ci":`${e} install --frozen-lockfile`}
|
|
50
|
+
`:""}
|
|
51
|
+
- name: ${t==="简体中文"?"构建文档":"Build Docs"}
|
|
52
|
+
env:
|
|
53
|
+
NODE_OPTIONS: --max_old_space_size=8192
|
|
54
|
+
run: |-
|
|
55
|
+
${e} run docs:build
|
|
56
|
+
> ${$(s,".vuepress/dist/.nojekyll").replace(/\\/g,"/")}
|
|
57
|
+
|
|
58
|
+
- name: ${t==="简体中文"?"部署文档":"Deploy Docs"}
|
|
59
|
+
uses: JamesIves/github-pages-deploy-action@v4
|
|
60
|
+
with:
|
|
61
|
+
# ${t==="简体中文"?"这是文档部署到的分支名称":"This is the branch where the docs are deployed to"}
|
|
62
|
+
branch: gh-pages
|
|
63
|
+
folder: ${$(s,".vuepress/dist").replace(/\\/g,"/")}
|
|
64
|
+
`,R=Array.isArray,v=e=>Object.prototype.toString.call(e)==="[object Object]",y=(e,...s)=>{if(s.length===0)return e;const t=s.shift()||null;return t&&Object.entries(t).forEach(([r,n])=>{r==="__proto__"||r==="constructor"||(v(e[r])&&v(n)?y(e[r],n):R(n)?e[r]=[...n]:v(n)?e[r]={...n}:e[r]=t[r])}),y(e,...s)},m=e=>{try{h(e)}catch{C(e,{recursive:!0})}},j=(e,s)=>{const t=b(s);m(t);const r=N(e),n=E(s);r.pipe(n)},S=(e,s)=>{m(s),h(e,{withFileTypes:!0}).forEach(t=>{t.isFile()?j(`${e}/${t.name}`,`${s}/${t.name}`):t.isDirectory()&&S(`${e}/${t.name}`,`${s}/${t.name}`)})},D=(e,s)=>{k(e).isDirectory()?S(e,s):k(e).isFile()&&j(e,s)},Y=(e=process.cwd())=>{try{return l("git status",{cwd:e}),!0}catch{return!1}},U=()=>{try{return l("git --version"),!0}catch{return!1}},V=()=>{try{return l("pnpm --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},L=()=>{try{return l("yarn --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},f=["npm"];L()&&f.push("yarn"),V()&&f.push("pnpm");const B=async e=>(await p.prompt([{name:"packageManager",type:"list",message:e,choices:f}])).packageManager,K=z(import.meta.url),M=b(K),T=async(e,{cwd:s=process.cwd(),packageManager:t,lang:r,message:n,preset:o})=>{const{workflow:i}=await p.prompt([{name:"workflow",type:"confirm",message:n.question.workflow,default:!0}]);if(o||(o=(await p.prompt([{name:"preset",type:"list",message:n.question.preset,choices:["blog","docs"]}])).preset),console.log(n.flow.generateTemplate),D(a(M,"../template/public"),a(s,e,"./.vuepress/public")),D(a(M,"../template",o),a(s,e)),i){const c=a(s,".github/workflows");m(c),d(a(c,"deploy-docs.yml"),J(t,e,r),{encoding:"utf-8"})}if(Y(s))x(e,s);else if(U()){const{git:c}=await p.prompt([{name:"git",type:"confirm",message:n.question.git,default:!0}]);c&&(l("git init",{cwd:s}),x(e,s))}},G=A(import.meta.url)("create-vuepress-theme-hope/package.json").version,Q=e=>({"docs:build":`vuepress build ${e}`,"docs:clean-dev":`vuepress dev ${e} --clean-cache`,"docs:dev":`vuepress dev ${e}`}),q=async(e,s,t=process.cwd())=>{const r=a(t,"package.json"),n=Q(s),o={"@vuepress/client":"2.0.0-beta.60",vue:"^3.2.45",vuepress:"2.0.0-beta.60","vuepress-theme-hope":G};if(g(r)){console.log(e.flow.updatePackage);const i=JSON.parse(w(r,{encoding:"utf-8"}));y(i,{scripts:n,devDependencies:o}),d(r,`${JSON.stringify(i,null,2)}
|
|
65
|
+
`,{encoding:"utf-8"})}else{console.log(e.flow.createPackage);const i={...await p.prompt([{name:"name",type:"input",message:e.question.name,default:"vuepress-theme-hope-template",validate:c=>/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u.exec(c)?!0:e.error.name},{name:"version",type:"input",message:e.question.version,default:"2.0.0",validate:c=>/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u.exec(c)?!0:e.error.version},{name:"description",type:"input",message:e.question.description,default:"A project of vuepress-theme-hope"},{name:"license",type:"input",message:e.question.license,default:"MIT"}]),type:"module",scripts:n,devDependencies:o};d(r,`${JSON.stringify(i,null,2)}
|
|
66
|
+
`,{encoding:"utf-8"})}},X="https://registry.npmmirror.com/",Z=e=>l(`${e} config get registry`).stdout,ee=async(e,s)=>{const t=Z(e);if(s==="简体中文"){const{registry:r}=await p.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return r==="国内镜像源"?X:t}return t},_=async(e,s)=>{if(!e)return u.outputHelp();const{lang:t,message:r}=await W();if(s&&!["docs","blog"].includes(s))return console.log(r.error.preset);const n=await B(r.question.packageManager);if(e.startsWith("[")&&e.endsWith("]"))return console.log(r.error.updateDirMissing(n));const o=a(process.cwd(),e);return g(o)&&h(o).length?console.error(r.error.dirNotEmpty(e)):(m(o),{lang:t,message:r,packageManager:n})},P=async({cwd:e=process.cwd(),lang:s,message:t,packageManager:r})=>{const n=r==="pnpm"?"":await ee(r,s);console.log(t.flow.install),console.warn(t.hint.install),l(`${r} install ${n?`--registry ${n}`:""}`,{cwd:e,stdout:"inherit"}),console.log(t.hint.finish);const{choice:o}=await p.prompt([{name:"choice",type:"confirm",message:t.question.devServer,default:!0}]);o?(console.log(t.flow.devServer),await O(`${r} run docs:dev`,{cwd:e,stdout:"inherit"})):console.log(t.hint.devServer(r))},u=I("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@next [dir] / npm init vuepress-theme-hope@next [dir]").example("docs").action(async(e,{preset:s=null})=>{const t=a(process.cwd(),e),r=await _(e,s);if(r){const{lang:n,message:o,packageManager:i}=r;await q(o,"src",e),await T("src",{cwd:t,packageManager:i,lang:n,message:o,preset:s}),await P({cwd:t,lang:n,message:o,packageManager:i})}}),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@next add [dir] / npm init vuepress-theme-hope@next add [dir]").example("docs").action(async(e,{preset:s=null})=>{const t=await _(e,s);if(t){const{lang:r,message:n,packageManager:o}=t;await q(n,e),await T(e,{packageManager:o,lang:r,message:n,preset:s}),await P({message:n,lang:r,packageManager:o})}}),u.help(()=>[{title:"pnpm create vuepress-theme-hope@next [dir] / npm init vuepress-theme-hope@next [dir]",body:"Create a vuepress-theme-hope template in [dir]"},{title:"pnpm create vuepress-theme-hope@next inject [dir] / npm init vuepress-theme-hope@next inject [dir]",body:"Add vuepress-theme-hope template in [dir] under current project"}]),u.version(G),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.160",
|
|
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.vuepress/",
|
|
11
13
|
"bugs": {
|
|
12
14
|
"url": "https://github.com/vuepress-theme-hope/vuepress-theme-hope/issues"
|
|
13
15
|
},
|
|
@@ -22,20 +24,28 @@
|
|
|
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
|
+
"template"
|
|
36
|
+
],
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"cac": "6.7.14",
|
|
39
|
+
"execa": "6.1.0",
|
|
40
|
+
"inquirer": "9.1.4"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/inquirer": "9.0.3"
|
|
27
44
|
},
|
|
28
45
|
"scripts": {
|
|
29
|
-
"build": "rollup -c",
|
|
46
|
+
"build": "rollup -c rollup.config.ts --configPlugin esbuild",
|
|
30
47
|
"clean": "rimraf ./lib ./*.tsbuildinfo",
|
|
31
|
-
"dev": "
|
|
48
|
+
"dev": "pnpm dev:ts",
|
|
32
49
|
"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": "14aac3784ac9bc4f5df1fed422efaf61a462829f"
|
|
41
|
-
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
shouldPrefetch: false,
|
|
23
|
+
});
|
|
@@ -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.vuepress/",
|
|
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.vuepress/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: "guide/",
|
|
10
|
+
link: "guide/",
|
|
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,246 @@
|
|
|
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
|
+
export default hopeTheme({
|
|
6
|
+
hostname: "https://mister-hope.github.io",
|
|
7
|
+
|
|
8
|
+
author: {
|
|
9
|
+
name: "Mr.Hope",
|
|
10
|
+
url: "https://mrhope.site",
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
iconAssets: "iconfont",
|
|
14
|
+
|
|
15
|
+
logo: "/logo.svg",
|
|
16
|
+
|
|
17
|
+
repo: "vuepress-theme-hope/vuepress-theme-hope",
|
|
18
|
+
|
|
19
|
+
docsDir: "docs",
|
|
20
|
+
|
|
21
|
+
blog: {
|
|
22
|
+
medias: {
|
|
23
|
+
Baidu: "https://example.com",
|
|
24
|
+
BiliBili: "https://example.com",
|
|
25
|
+
Bitbucket: "https://example.com",
|
|
26
|
+
Dingding: "https://example.com",
|
|
27
|
+
Discord: "https://example.com",
|
|
28
|
+
Dribbble: "https://example.com",
|
|
29
|
+
Email: "https://example.com",
|
|
30
|
+
Evernote: "https://example.com",
|
|
31
|
+
Facebook: "https://example.com",
|
|
32
|
+
Flipboard: "https://example.com",
|
|
33
|
+
Gitee: "https://example.com",
|
|
34
|
+
GitHub: "https://example.com",
|
|
35
|
+
Gitlab: "https://example.com",
|
|
36
|
+
Gmail: "https://example.com",
|
|
37
|
+
Instagram: "https://example.com",
|
|
38
|
+
Lark: "https://example.com",
|
|
39
|
+
Lines: "https://example.com",
|
|
40
|
+
Linkedin: "https://example.com",
|
|
41
|
+
Pinterest: "https://example.com",
|
|
42
|
+
Pocket: "https://example.com",
|
|
43
|
+
QQ: "https://example.com",
|
|
44
|
+
Qzone: "https://example.com",
|
|
45
|
+
Reddit: "https://example.com",
|
|
46
|
+
Rss: "https://example.com",
|
|
47
|
+
Steam: "https://example.com",
|
|
48
|
+
Twitter: "https://example.com",
|
|
49
|
+
Wechat: "https://example.com",
|
|
50
|
+
Weibo: "https://example.com",
|
|
51
|
+
Whatsapp: "https://example.com",
|
|
52
|
+
Youtube: "https://example.com",
|
|
53
|
+
Zhihu: "https://example.com",
|
|
54
|
+
MrHope: [
|
|
55
|
+
"https://mrhope.site",
|
|
56
|
+
'<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>',
|
|
57
|
+
],
|
|
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
|
+
// If you don’t need comment feature, you can remove following option
|
|
120
|
+
// The following config is for demo ONLY, if you need comment feature, please generate and use your own config, see comment plugin documentation for details.
|
|
121
|
+
// To avoid disturbing the theme developer and consuming his resources, please DO NOT use the following config directly in your production environment!!!!!
|
|
122
|
+
comment: {
|
|
123
|
+
/**
|
|
124
|
+
* Using Giscus
|
|
125
|
+
*/
|
|
126
|
+
provider: "Giscus",
|
|
127
|
+
repo: "vuepress-theme-hope/giscus-discussions",
|
|
128
|
+
repoId: "R_kgDOG_Pt2A",
|
|
129
|
+
category: "Announcements",
|
|
130
|
+
categoryId: "DIC_kwDOG_Pt2M4COD69",
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Using Twikoo
|
|
134
|
+
*/
|
|
135
|
+
// provider: "Twikoo",
|
|
136
|
+
// envId: "https://twikoo.ccknbc.vercel.app",
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Using Waline
|
|
140
|
+
*/
|
|
141
|
+
// provider: "Waline",
|
|
142
|
+
// serverURL: "https://vuepress-theme-hope-comment.vercel.app",
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
// Disable features you don’t want here
|
|
146
|
+
mdEnhance: {
|
|
147
|
+
align: true,
|
|
148
|
+
attrs: true,
|
|
149
|
+
chart: true,
|
|
150
|
+
codetabs: true,
|
|
151
|
+
container: true,
|
|
152
|
+
demo: true,
|
|
153
|
+
echarts: true,
|
|
154
|
+
figure: true,
|
|
155
|
+
flowchart: true,
|
|
156
|
+
gfm: true,
|
|
157
|
+
imgLazyload: true,
|
|
158
|
+
imgSize: true,
|
|
159
|
+
include: true,
|
|
160
|
+
katex: true,
|
|
161
|
+
mark: true,
|
|
162
|
+
mermaid: true,
|
|
163
|
+
playground: {
|
|
164
|
+
presets: ["ts", "vue"],
|
|
165
|
+
},
|
|
166
|
+
presentation: {
|
|
167
|
+
plugins: ["highlight", "math", "search", "notes", "zoom"],
|
|
168
|
+
},
|
|
169
|
+
stylize: [
|
|
170
|
+
{
|
|
171
|
+
matcher: "Recommended",
|
|
172
|
+
replacer: ({ tag }) => {
|
|
173
|
+
if (tag === "em")
|
|
174
|
+
return {
|
|
175
|
+
tag: "Badge",
|
|
176
|
+
attrs: { type: "tip" },
|
|
177
|
+
content: "Recommended",
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
sub: true,
|
|
183
|
+
sup: true,
|
|
184
|
+
tabs: true,
|
|
185
|
+
vPre: true,
|
|
186
|
+
vuePlayground: true,
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
// uncomment these if you want a PWA
|
|
190
|
+
// pwa: {
|
|
191
|
+
// favicon: "/favicon.ico",
|
|
192
|
+
// cacheHTML: true,
|
|
193
|
+
// cachePic: true,
|
|
194
|
+
// appendBase: true,
|
|
195
|
+
// apple: {
|
|
196
|
+
// icon: "/assets/icon/apple-icon-152.png",
|
|
197
|
+
// statusBarColor: "black",
|
|
198
|
+
// },
|
|
199
|
+
// msTile: {
|
|
200
|
+
// image: "/assets/icon/ms-icon-144.png",
|
|
201
|
+
// color: "#ffffff",
|
|
202
|
+
// },
|
|
203
|
+
// manifest: {
|
|
204
|
+
// icons: [
|
|
205
|
+
// {
|
|
206
|
+
// src: "/assets/icon/chrome-mask-512.png",
|
|
207
|
+
// sizes: "512x512",
|
|
208
|
+
// purpose: "maskable",
|
|
209
|
+
// type: "image/png",
|
|
210
|
+
// },
|
|
211
|
+
// {
|
|
212
|
+
// src: "/assets/icon/chrome-mask-192.png",
|
|
213
|
+
// sizes: "192x192",
|
|
214
|
+
// purpose: "maskable",
|
|
215
|
+
// type: "image/png",
|
|
216
|
+
// },
|
|
217
|
+
// {
|
|
218
|
+
// src: "/assets/icon/chrome-512.png",
|
|
219
|
+
// sizes: "512x512",
|
|
220
|
+
// type: "image/png",
|
|
221
|
+
// },
|
|
222
|
+
// {
|
|
223
|
+
// src: "/assets/icon/chrome-192.png",
|
|
224
|
+
// sizes: "192x192",
|
|
225
|
+
// type: "image/png",
|
|
226
|
+
// },
|
|
227
|
+
// ],
|
|
228
|
+
// shortcuts: [
|
|
229
|
+
// {
|
|
230
|
+
// name: "Demo",
|
|
231
|
+
// short_name: "Demo",
|
|
232
|
+
// url: "/demo/",
|
|
233
|
+
// icons: [
|
|
234
|
+
// {
|
|
235
|
+
// src: "/assets/icon/guide-maskable.png",
|
|
236
|
+
// sizes: "192x192",
|
|
237
|
+
// purpose: "maskable",
|
|
238
|
+
// type: "image/png",
|
|
239
|
+
// },
|
|
240
|
+
// ],
|
|
241
|
+
// },
|
|
242
|
+
// ],
|
|
243
|
+
// },
|
|
244
|
+
// },
|
|
245
|
+
},
|
|
246
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
@@ -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.vuepress/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)
|