create-vuepress-theme-hope 2.0.0-rc.4 → 2.0.0-rc.41

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.
Files changed (56) hide show
  1. package/README.md +2 -2
  2. package/lib/index.js +30 -28
  3. package/package.json +10 -10
  4. package/template/blog/config/base/logo.ts +2 -0
  5. package/template/blog/config/en/navbar.ts +1 -0
  6. package/template/blog/config/en/sidebar.ts +5 -1
  7. package/template/blog/config/en/theme.ts +48 -43
  8. package/template/blog/config/multi/navbar/en.ts +1 -0
  9. package/template/blog/config/multi/navbar/zh.ts +1 -0
  10. package/template/blog/config/multi/sidebar/en.ts +5 -1
  11. package/template/blog/config/multi/sidebar/zh.ts +5 -1
  12. package/template/blog/config/multi/theme.ts +48 -43
  13. package/template/blog/config/zh/config.ts +1 -1
  14. package/template/blog/config/zh/navbar.ts +1 -0
  15. package/template/blog/config/zh/sidebar.ts +5 -1
  16. package/template/blog/config/zh/theme.ts +60 -53
  17. package/template/blog/en/README.md +3 -3
  18. package/template/blog/en/demo/README.md +1 -9
  19. package/template/blog/en/demo/disable.md +1 -1
  20. package/template/blog/en/demo/layout.md +31 -0
  21. package/template/blog/en/demo/markdown.md +148 -246
  22. package/template/blog/en/demo/page.md +67 -20
  23. package/template/blog/en/portfolio.md +22 -0
  24. package/template/blog/zh/README.md +3 -3
  25. package/template/blog/zh/demo/README.md +1 -9
  26. package/template/blog/zh/demo/disable.md +1 -1
  27. package/template/blog/zh/demo/encrypt.md +1 -1
  28. package/template/blog/zh/demo/layout.md +31 -0
  29. package/template/blog/zh/demo/markdown.md +154 -232
  30. package/template/blog/zh/demo/page.md +70 -19
  31. package/template/blog/zh/portfolio.md +23 -0
  32. package/template/docs/config/en/sidebar.ts +5 -1
  33. package/template/docs/config/en/theme.ts +42 -37
  34. package/template/docs/config/multi/sidebar/en.ts +5 -1
  35. package/template/docs/config/multi/sidebar/zh.ts +5 -1
  36. package/template/docs/config/multi/theme.ts +48 -43
  37. package/template/docs/config/zh/config.ts +1 -1
  38. package/template/docs/config/zh/sidebar.ts +5 -1
  39. package/template/docs/config/zh/theme.ts +57 -48
  40. package/template/docs/en/README.md +6 -1
  41. package/template/docs/en/demo/README.md +1 -9
  42. package/template/docs/en/demo/disable.md +1 -1
  43. package/template/docs/en/demo/layout.md +31 -0
  44. package/template/docs/en/demo/markdown.md +148 -246
  45. package/template/docs/en/demo/page.md +67 -18
  46. package/template/docs/zh/README.md +6 -1
  47. package/template/docs/zh/demo/README.md +1 -9
  48. package/template/docs/zh/demo/disable.md +1 -1
  49. package/template/docs/zh/demo/encrypt.md +1 -1
  50. package/template/docs/zh/demo/layout.md +31 -0
  51. package/template/docs/zh/demo/markdown.md +154 -232
  52. package/template/docs/zh/demo/page.md +72 -19
  53. package/template/blog/en/slides.md +0 -433
  54. package/template/blog/zh/slides.md +0 -429
  55. package/template/docs/en/slides.md +0 -433
  56. package/template/docs/zh/slides.md +0 -429
package/README.md CHANGED
@@ -8,7 +8,7 @@ Create template shortcut for vuepress-theme-hope.
8
8
 
9
9
  ```bash
10
10
  # npm
11
- npm init vuepress-theme-hope <dir>
11
+ npm init vuepress-theme-hope@latest <dir>
12
12
 
13
13
  # yarn
14
14
  yarn create vuepress-theme-hope <dir>
@@ -25,7 +25,7 @@ pnpm create vuepress-theme-hope <dir>
25
25
 
26
26
  ```bash
27
27
  # npm
28
- npm init vuepress-theme-hope <dir>
28
+ npm init vuepress-theme-hope@latest <dir>
29
29
 
30
30
  # yarn
31
31
  yarn create vuepress-theme-hope <dir>
package/lib/index.js CHANGED
@@ -1,25 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import{existsSync as f,readFileSync as S,writeFileSync as v,readdirSync as w,mkdirSync as A,statSync as j,createReadStream as C,createWriteStream as I}from"node:fs";import{resolve as o,join as x,dirname as D}from"node:path";import{cac as O}from"cac";import{execaCommandSync as c,execaCommand as R}from"execa";import m from"inquirer";import{createRequire as F}from"node:module";import{fileURLToPath as W}from"node:url";const H={简体中文:{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.`}}},J=async()=>{const{language:e}=await m.prompt([{name:"language",type:"list",message:"Select a language to display / 选择显示语言",choices:["english (US)","简体中文"]}]);return{lang:e,message:H[e]}},Y=e=>`
2
+ import{existsSync as f,readFileSync as b,writeFileSync as h,readdirSync as $,mkdirSync as A,statSync as j,createReadStream as I,createWriteStream as W}from"node:fs";import{resolve as n,join as x,dirname as N}from"node:path";import{cac as F}from"cac";import{execaCommandSync as p,execaCommand as J}from"execa";import u from"inquirer";import{createRequire as H}from"node:module";import{fileURLToPath as U}from"node:url";const D=["vite","webpack"],M=["blog","docs"],Y=e=>`
11
3
  node_modules/
12
4
  ${e}/.vuepress/.cache/
13
5
  ${e}/.vuepress/.temp/
14
6
  ${e}/.vuepress/dist/
15
- `,M=(e,t=process.cwd())=>{const s=o(t,".gitignore"),r=f(s)?S(s,{encoding:"utf-8"}):"";v(s,`${r}${Y(e)}`,{encoding:"utf-8"})},U=(e,t,s)=>`
16
- name: ${s==="简体中文"?"部署文档":"Deploy Docs"}
7
+ `,T=(e,t=process.cwd())=>{const o=n(t,".gitignore"),s=f(o)?b(o,{encoding:"utf-8"}):"";h(o,`${s}${Y(e)}`,{encoding:"utf-8"})},V=(e,t,o,{workflow:s})=>`
8
+ name: ${s.name}
17
9
 
18
10
  on:
19
11
  push:
20
12
  branches:
21
- # ${s==="简体中文"?"确保这是你正在使用的分支名称":"make sure this is the branch you are using"}
22
- - main
13
+ - ${p("git branch --show-current",{cwd:t}).stdout.trim()}
23
14
 
24
15
  permissions:
25
16
  contents: write
@@ -32,38 +23,49 @@ jobs:
32
23
  uses: actions/checkout@v3
33
24
  with:
34
25
  fetch-depth: 0
35
- # ${s==="简体中文"?"如果你文档需要 Git 子模块,取消注释下一行":"if your docs needs submodules, uncomment the following line"}
26
+ # ${s.submodule}
36
27
  # submodules: true
37
28
 
38
- ${e==="pnpm"?` - name: ${s==="简体中文"?"安装 pnpm":"Install pnpm"}
29
+ ${e==="pnpm"?` - name: ${s.setupPnpm}
39
30
  uses: pnpm/action-setup@v2
40
31
  with:
41
- run_install: true
42
32
  version: 8
43
33
  `:""}
44
34
 
45
- - name: ${s==="简体中文"?"设置 Node.js":"Setup Node.js"}
35
+ - name: ${s.setupNode}
46
36
  uses: actions/setup-node@v3
47
37
  with:
48
38
  node-version: 20
49
39
  cache: ${e}
50
40
 
51
- ${e!=="pnpm"?` - name: ${s==="简体中文"?"安装依赖":"Install Deps"}
52
- run: ${e==="npm"?"npm ci":`${e} install --frozen-lockfile`}
53
- `:""}
54
- - name: ${s==="简体中文"?"构建文档":"Build Docs"}
41
+ - name: ${s.install}
42
+ run: |
43
+ corepack enable
44
+ ${e==="npm"?"npm ci":`${e} install --frozen-lockfile`}
45
+
46
+ - name: ${s.build}
55
47
  env:
56
48
  NODE_OPTIONS: --max_old_space_size=8192
57
49
  run: |-
58
50
  ${e} run docs:build
59
- > ${x(t,".vuepress/dist/.nojekyll").replace(/\\/g,"/")}
51
+ > ${x(o,".vuepress/dist/.nojekyll").replace(/\\/g,"/")}
60
52
 
61
- - name: ${s==="简体中文"?"部署文档":"Deploy Docs"}
53
+ - name: ${s.deploy}
62
54
  uses: JamesIves/github-pages-deploy-action@v4
63
55
  with:
64
- # ${s==="简体中文"?"这是文档部署到的分支名称":"This is the branch where the docs are deployed to"}
56
+ # ${s.deploy}
65
57
  branch: gh-pages
66
- folder: ${x(t,".vuepress/dist").replace(/\\/g,"/")}
67
- `,V=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u,L=/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u,B=Array.isArray,$=e=>Object.prototype.toString.call(e)==="[object Object]",k=(e,...t)=>{if(t.length===0)return e;const s=t.shift()||null;return s&&Object.entries(s).forEach(([r,a])=>{r==="__proto__"||r==="constructor"||($(e[r])&&$(a)?k(e[r],a):B(a)?e[r]=[...a]:$(a)?e[r]={...a}:e[r]=s[r])}),k(e,...t)},y=e=>{try{w(e)}catch{try{A(e,{recursive:!0})}catch{}}},G=(e,t)=>{const s=D(t);y(s);const r=C(e),a=I(t);r.pipe(a)},T=(e,t)=>{y(t),w(e,{withFileTypes:!0}).forEach(s=>{s.isFile()?G(`${e}/${s.name}`,`${t}/${s.name}`):s.isDirectory()&&T(`${e}/${s.name}`,`${t}/${s.name}`)})},p=(e,t)=>{j(e).isDirectory()?T(e,t):j(e).isFile()&&G(e,t)},K=(e=process.cwd())=>{try{return c("git status",{cwd:e}),!0}catch{return!1}},Q=()=>{try{return c("git --version"),!0}catch{return!1}},X=()=>{try{return c("pnpm --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},Z=()=>{try{return c("yarn --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},b=["npm"];Z()&&b.push("yarn"),X()&&b.push("pnpm");const ee=async e=>(await m.prompt([{name:"packageManager",type:"list",message:e,choices:b}])).packageManager,te=W(import.meta.url),l=D(te),_=async(e,{cwd:t=process.cwd(),packageManager:s,lang:r,message:a,preset:n})=>{const{i18n:u,workflow:d}=await m.prompt([{name:"i18n",type:"confirm",message:a.question.i18n,default:!1},{name:"workflow",type:"confirm",message:a.question.workflow,default:!0}]);n||(n=(await m.prompt([{name:"preset",type:"list",message:a.question.preset,choices:["blog","docs"]}])).preset),console.log(a.flow.generateTemplate);const i=n;if(p(o(l,"../template/public"),o(t,e,"./.vuepress/public")),p(o(l,"../template",i,"config/base"),o(t,e,".vuepress")),u?(p(o(l,"../template",i,"en"),o(t,e)),p(o(l,"../template",i,"zh"),o(t,e,"zh")),p(o(l,"../template",i,"config/multi"),o(t,e,".vuepress"))):r==="简体中文"?(p(o(l,"../template",i,"zh"),o(t,e)),p(o(l,"../template",i,"config/zh"),o(t,e,".vuepress"))):(p(o(l,"../template",i,"en"),o(t,e)),p(o(l,"../template",i,"config/en"),o(t,e,".vuepress"))),d){const h=o(t,".github/workflows");y(h),v(o(h,"deploy-docs.yml"),U(s,e,r),{encoding:"utf-8"})}if(K(t))M(e,t);else if(Q()){const{git:h}=await m.prompt([{name:"git",type:"confirm",message:a.question.git,default:!0}]);h&&(c("git init",{cwd:t}),M(e,t))}},E=F(import.meta.url)("create-vuepress-theme-hope/package.json").version,se=(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`}),q=async(e,t,s,r=process.cwd())=>{const a=o(r,"package.json"),n=se(e,s),u={"@vuepress/client":"2.0.0-rc.0",vue:"^3.3.11",vuepress:"2.0.0-rc.0","vuepress-theme-hope":E};if(f(a)){console.log(t.flow.updatePackage);const d=JSON.parse(S(a,{encoding:"utf-8"}));k(d,{scripts:n,devDependencies:u}),v(a,`${JSON.stringify(d,null,2)}
68
- `,{encoding:"utf-8"})}else{console.log(t.flow.createPackage);const d={...await m.prompt([{name:"name",type:"input",message:t.question.name,default:"vuepress-theme-hope-template",validate:i=>V.exec(i)?!0:t.error.name},{name:"version",type:"input",message:t.question.version,default:"2.0.0",validate:i=>L.exec(i)?!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:n,devDependencies:u};v(a,`${JSON.stringify(d,null,2)}
69
- `,{encoding:"utf-8"})}},P="https://registry.npmmirror.com/",re=(e,t)=>c(`${e} config get ${t?"npmRegistryServer":"registry"}}`).stdout,ae=async(e,t)=>{const s=e==="yarn"&&!c("yarn --version").stdout.startsWith("1"),r=re(e,s);if(/https:\/\/registry\.npm\.taobao\.org\/?/.test(r)&&(console.error("npm.taobao.org is no longer available, resetting it to npmmirror.com"),c(`${e} config set ${s?"npmRegistryServer":"registry"}} ${P}`)),t==="简体中文"){const{registry:a}=await m.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return a==="国内镜像源"?P:r}return r},z=async(e,t)=>{if(!e)return g.outputHelp();const{lang:s,message:r}=await J();if(t&&!["docs","blog"].includes(t))return console.log(r.error.preset);const a=o(process.cwd(),e);if(f(a)&&w(a).length)return console.error(r.error.dirNotEmpty(e));const n=await ee(r.question.packageManager);return e.startsWith("[")&&e.endsWith("]")?console.log(r.error.updateDirMissing(n)):(y(a),{lang:s,message:r,packageManager:n})},N=async({cwd:e=process.cwd(),lang:t,message:s,packageManager:r})=>{const a=r==="pnpm"?"":await ae(r,t);console.log(s.flow.install),console.warn(s.hint.install),c(`${r} install ${a?`--registry ${a}`:""}`,{cwd:e,stdout:"inherit"}),console.log(s.hint.finish);const{choice:n}=await m.prompt([{name:"choice",type:"confirm",message:s.question.devServer,default:!0}]);n?(console.log(s.flow.devServer),await R(`${r} run docs:dev`,{cwd:e,stdout:"inherit"})):console.log(s.hint.devServer(r))},g=O("vuepress-theme-hope");g.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=o(process.cwd(),e),r=await z(e,t);if(r){const{lang:a,message:n,packageManager:u}=r;await q(u,n,"src",e),await _("src",{cwd:s,packageManager:u,lang:a,message:n,preset:t}),await N({cwd:s,lang:a,message:n,packageManager:u})}}),g.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 z(e,t);if(s){const{lang:r,message:a,packageManager:n}=s;await q(n,a,e),await _(e,{packageManager:n,lang:r,message:a,preset:t}),await N({message:a,lang:r,packageManager:n})}}),g.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"}]),g.version(E),g.parse();
58
+ folder: ${x(o,".vuepress/dist").replace(/\\/g,"/")}
59
+ `,B=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u,L=/^[0-9]+\.[0-9]+\.(?:[0-9]+|[0-9]+-[a-z]+\.[0-9])$/u,{isArray:K}=Array,k=e=>Object.prototype.toString.call(e)==="[object Object]",y=(e,...t)=>{if(t.length===0)return e;const o=t.shift();return o&&Object.entries(o).forEach(([s,r])=>{s==="__proto__"||s==="constructor"||(k(e[s])&&k(r)?y(e[s],r):K(r)?e[s]=[...r]:k(r)?e[s]={...r}:e[s]=o[s])}),y(e,...t)},w=e=>{try{$(e)}catch{try{A(e,{recursive:!0})}catch{}}},C=(e,t)=>{const o=N(t);w(o);const s=I(e),r=W(t);s.pipe(r)},G=(e,t)=>{w(t),$(e,{withFileTypes:!0}).forEach(o=>{o.isFile()?C(`${e}/${o.name}`,`${t}/${o.name}`):o.isDirectory()&&G(`${e}/${o.name}`,`${t}/${o.name}`)})},d=(e,t)=>{j(e).isDirectory()?G(e,t):j(e).isFile()&&C(e,t)},Q=(e=process.cwd())=>{try{return p("git status",{cwd:e}),!0}catch{return!1}},X=()=>{try{return p("git --version"),!0}catch{return!1}},Z=()=>{try{return p("pnpm --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},ee=()=>{try{return p("yarn --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},S=["npm"];ee()&&S.unshift("yarn"),Z()&&S.unshift("pnpm");const te=async e=>(await u.prompt([{name:"packageManager",type:"list",message:e,choices:S}])).packageManager,E="https://registry.npmmirror.com/",se=(e,t)=>p(`${e} config get ${t?"npmRegistryServer":"registry"}`).stdout,oe=async(e,t)=>{const o=e==="yarn"&&!p("yarn --version").stdout.startsWith("1"),s=se(e,o);if(/https:\/\/registry\.npm\.taobao\.org\/?/.test(s)&&(console.error("npm.taobao.org is no longer available, resetting it to npmmirror.com"),p(`${e} config set ${o?"npmRegistryServer":"registry"} ${E}`)),t==="简体中文"){const{registry:r}=await u.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return r==="国内镜像源"?E:s}return s},re=U(import.meta.url),g=N(re),O=async({cwd:e=process.cwd(),targetDir:t,lang:o,locale:s,preset:r,packageManager:a})=>{const{i18n:i,workflow:l}=await u.prompt([{name:"i18n",type:"confirm",message:s.question.i18n,default:!1},{name:"workflow",type:"confirm",message:s.question.workflow,default:!0}]);r||({preset:r}=await u.prompt([{name:"preset",type:"list",message:s.question.preset,choices:M}])),console.log(s.flow.generateTemplate);const c=r;if(d(n(g,"../template/public"),n(e,t,"./.vuepress/public")),d(n(g,"../template",c,"config/base"),n(e,t,".vuepress")),i?(d(n(g,"../template",c,"en"),n(e,t)),d(n(g,"../template",c,"zh"),n(e,t,"zh")),d(n(g,"../template",c,"config/multi"),n(e,t,".vuepress"))):o==="简体中文"?(d(n(g,"../template",c,"zh"),n(e,t)),d(n(g,"../template",c,"config/zh"),n(e,t,".vuepress"))):(d(n(g,"../template",c,"en"),n(e,t)),d(n(g,"../template",c,"config/en"),n(e,t,".vuepress"))),Q(e))T(t,e);else if(X()){const{git:m}=await u.prompt([{name:"git",type:"confirm",message:s.question.git,default:!0}]);m&&(p("git init -b main",{cwd:e}),T(t,e))}if(l){const m=n(e,".github/workflows");w(m),h(n(m,"deploy-docs.yml"),V(a,e,t,s),{encoding:"utf-8"})}},{version:P}=H(import.meta.url)("create-vuepress-theme-hope/package.json"),ne={flow:{getVersion:"Getting latest version of deps...",createPackage:"Generating package.json...",updatePackage:"Updating package.json...",createTsConfig:"Generating tsconfig.json...",updateTsConfig:"Updating tsconfig.json...",generateTemplate:"Generating Template...",install:"Installing Deps...",devServer:`Staring dev server...
60
+ 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?",bundler:"Which bundler do you want to use?",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.
61
+ 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.`},workflow:{name:"Deploy Docs",checkout:"Checkout code",submodule:"if your docs needs submodules, uncomment the following line",setupPnpm:"Setup pnpm",setupNode:"Setup Node.js",install:"Install Deps",build:"Build Docs",deploy:"Deploy Docs",deployBranch:"This is the branch where the docs are deployed to"},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'",bundler:'bundler (--bundler) only support "vite" or "webpack"',preset:'preset (--preset) only support "docs" 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"
62
+ 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"
63
+ 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.`}},ae={flow:{getVersion:"获取依赖的最新版本...",createPackage:"生成 package.json...",updatePackage:"更新 package.json...",createTsConfig:"生成 tsconfig.json...",updateTsConfig:"更新 tsconfig.json...",generateTemplate:"生成模板...",install:"安装依赖...",devServer:`启动开发服务器...
64
+ 启动成功后,请在浏览器输入给出的开发服务器地址(默认为 'localhost:8080')`},question:{packageManager:"选择包管理器",i18n:"项目需要用到多语言么?",git:"是否初始化 Git 仓库?",workflow:"是否需要一个自动部署文档到 GitHub Pages 的工作流?",bundler:"你想要使用哪个打包器?",preset:"你想要创建什么类型的项目?",devServer:"是否想要现在启动 Demo 查看?",name:"设置应用名称",version:"设置应用版本号",description:"设置应用描述",license:"设置协议"},hint:{install:`这可能需要数分钟,请耐心等待.
65
+ 我们无法正确输出子进程的进度条,所以进程可能会看似未响应`,finish:"模板已成功生成!",devServer:e=>`提示: 请使用 "${e} run docs:dev" 命令启动开发服务器`},workflow:{name:"部署文档",checkout:"检出代码",submodule:"如果你文档需要 Git 子模块,取消注释下一行",setupPnpm:"设置 pnpm",setupNode:"设置 Node.js",install:"安装依赖",build:"构建文档",deploy:"部署文档",deployBranch:"这是文档部署到的分支名称"},error:{name:"应用名称应只包含小写字母、数字和连接线 (-)",version:"此版本无效,版本号应为 'x.x.x'",bundler:"打包器 (--bundler) 仅支持 vite 或 webpack",preset:"预设 (--preset) 仅支持 docs 或 blog",outputDirMissing:e=>`"[dir]" 的方括号表示此处为一个参数,你应该替换为自己想使用的文件夹名称,如 "my-blog", "project-docs" 等!
66
+ 例如: "${e} init vuepress-theme-hope project-docs"`,updateDirMissing:e=>`"[dir]" 的方括号表示此处为一个参数,你应该替换为自己想使用的文件夹名称,如 "src", "docs" 等!
67
+ 例如: "${e} init vuepress-theme-hope docs"`,dirNotEmpty:e=>`目标文件夹 "${e}" 不为空,请选择一个空文件夹或者手动删除文件夹中的文件`}},ie={"english (US)":ne,简体中文:ae},ce=async()=>{const{language:e}=await u.prompt([{name:"language",type:"list",message:"Select a language to display / 选择显示语言",choices:["english (US)","简体中文"]}]);return{lang:e,locale:ie[e]}},pe=(e,t,o)=>({"docs:build":`vuepress-${t} build ${o}`,"docs:clean-dev":`vuepress-${t} dev ${o} --clean-cache`,"docs:dev":`vuepress-${t} dev ${o}`,"docs:update-package":`${e==="npm"?"npx":`${e} dlx`} vp-update`}),_=async({packageManager:e,locale:t,source:o,bundler:s,cwd:r=process.cwd()})=>{s||({bundler:s}=await u.prompt([{name:"bundler",type:"list",message:t.question.bundler,choices:D}]));const a=n(r,"package.json"),i=pe(e,s,o),l={[`@vuepress/bundler-${s}`]:"2.0.0-rc.9",vue:"^3.4.27",vuepress:"2.0.0-rc.9","vuepress-theme-hope":P};if(s==="webpack"&&(l["sass-loader"]="^14.2.1"),f(a)){console.log(t.flow.updatePackage);const c=JSON.parse(b(a,{encoding:"utf-8"}));y(c,{scripts:i,devDependencies:l}),h(a,`${JSON.stringify(c,null,2)}
68
+ `,{encoding:"utf-8"})}else{console.log(t.flow.createPackage);const c={...await u.prompt([{name:"name",type:"input",message:t.question.name,default:"vuepress-theme-hope-template",validate:m=>B.exec(m)?!0:t.error.name},{name:"version",type:"input",message:t.question.version,default:"2.0.0",validate:m=>L.exec(m)?!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:i,devDependencies:l};h(a,`${JSON.stringify(c,null,2)}
69
+ `,{encoding:"utf-8"})}},q=({source:e,locale:t,cwd:o=process.cwd()})=>{const s=n(o,"tsconfig.json");if(f(s)){console.log(t.flow.updateTsConfig);const r=JSON.parse(b(s,{encoding:"utf-8"}));y(r,{compilerOptions:{module:"NodeNext",moduleResolution:"NodeNext"},include:[...r.include??[],`${e}/.vuepress/**/*.ts`,`${e}/.vuepress/**/*.vue`]}),h(s,`${JSON.stringify(r,null,2)}
70
+ `,{encoding:"utf-8"})}else{console.log(t.flow.createTsConfig);const r={compilerOptions:{module:"NodeNext",moduleResolution:"NodeNext",target:"ES2022"},include:[`${e}/.vuepress/**/*.ts`,`${e}/.vuepress/**/*.vue`],exclude:["node_modules"]};h(s,`${JSON.stringify(r,null,2)}
71
+ `,{encoding:"utf-8"})}},z=async(e,{bundler:t,preset:o})=>{if(!e)return v.outputHelp();const{lang:s,locale:r}=await ce();if(t&&!D.includes(t))return console.log(r.error.bundler);if(o&&!M.includes(o))return console.log(r.error.preset);const a=n(process.cwd(),e);if(f(a)&&$(a).length)return console.error(r.error.dirNotEmpty(e));const i=await te(r.question.packageManager);return e.startsWith("[")&&e.endsWith("]")?console.log(r.error.updateDirMissing(i)):(w(a),{lang:s,locale:r,packageManager:i})},R=async({cwd:e=process.cwd(),lang:t,locale:o,packageManager:s})=>{const r=s==="pnpm"?"":await oe(s,t);console.log(o.flow.install),console.warn(o.hint.install),p(`${s} install ${r?`--registry ${r}`:""}`,{cwd:e,stdout:"inherit"}),console.log(o.hint.finish);const{choice:a}=await u.prompt([{name:"choice",type:"confirm",message:o.question.devServer,default:!0}]);a?(console.log(o.flow.devServer),await J(`${s} run docs:dev`,{cwd:e,stdout:"inherit"})):console.log(o.hint.devServer(s))},v=F("vuepress-theme-hope");v.command("[dir]","Generate a new vuepress-theme-hope project").option("-p, --preset <preset>","Choose preset to use").usage("pnpm create vuepress-theme-hope [dir] / npm init vuepress-theme-hope@latest [dir] / yarn create vuepress-theme-hope [dir]").example("docs").action(async(e,{bundler:t=null,preset:o=null})=>{const s=n(process.cwd(),e),r=await z(e,{bundler:t,preset:o});if(r){const{lang:a,locale:i,packageManager:l}=r;await _({bundler:t,locale:i,packageManager:l,cwd:e,source:"src"}),q({cwd:e,source:"src",locale:i}),await O({preset:o,lang:a,locale:i,packageManager:l,cwd:s,targetDir:"src"}),await R({lang:a,locale:i,packageManager:l,cwd:s})}}),v.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] / npm init vuepress-theme-hope@latest add [dir] / yarn create vuepress-theme-hope add [dir]").example("docs").action(async(e,{bundler:t=null,preset:o=null})=>{const s=await z(e,{bundler:t,preset:o});if(s){const{lang:r,locale:a,packageManager:i}=s;await _({bundler:t,packageManager:i,locale:a,source:e}),q({source:e,locale:a}),await O({packageManager:i,lang:r,locale:a,preset:o,targetDir:e}),await R({lang:r,locale:a,packageManager:i})}}),v.help(()=>[{title:"pnpm create vuepress-theme-hope [dir] / yarn create vuepress-theme-hope [dir] / npm init vuepress-theme-hope@latest [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@latest inject [dir]",body:"Add vuepress-theme-hope template in [dir] under current project"}]),v.version(P),v.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vuepress-theme-hope",
3
- "version": "2.0.0-rc.4",
3
+ "version": "2.0.0-rc.41",
4
4
  "description": "Create vuepress-theme-hope demo project helper",
5
5
  "keywords": [
6
6
  "create",
@@ -37,23 +37,23 @@
37
37
  "lib",
38
38
  "template"
39
39
  ],
40
- "engines": {
41
- "node": ">=18.16.0",
42
- "npm": ">=8",
43
- "pnpm": ">=7",
44
- "yarn": ">=2"
45
- },
46
40
  "dependencies": {
47
41
  "cac": "6.7.14",
48
- "execa": "8.0.1",
49
- "inquirer": "9.2.12"
42
+ "execa": "9.0.2",
43
+ "inquirer": "9.2.20"
50
44
  },
51
45
  "devDependencies": {
52
46
  "@types/inquirer": "9.0.7"
53
47
  },
48
+ "engines": {
49
+ "node": ">=18.19.0",
50
+ "npm": ">=8",
51
+ "pnpm": ">=7",
52
+ "yarn": ">=2"
53
+ },
54
54
  "scripts": {
55
55
  "build": "rollup -c rollup.config.ts --configPlugin esbuild",
56
- "clean": "rimraf ./lib ./*.tsbuildinfo",
56
+ "clean": "rimraf --glob ./lib ./*.tsbuildinfo",
57
57
  "dev": "pnpm dev:ts",
58
58
  "dev:ts": "tsc -b tsconfig.build.json --watch"
59
59
  }
@@ -0,0 +1,2 @@
1
+ export const MR_HOPE_AVATAR =
2
+ '<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>';
@@ -2,6 +2,7 @@ import { navbar } from "vuepress-theme-hope";
2
2
 
3
3
  export default navbar([
4
4
  "/",
5
+ "/portfolio",
5
6
  "/demo/",
6
7
  {
7
8
  text: "Posts",
@@ -17,6 +17,10 @@ export default sidebar({
17
17
  children: "structure",
18
18
  },
19
19
  "intro",
20
- "slides",
20
+ {
21
+ text: "Slides",
22
+ icon: "person-chalkboard",
23
+ link: "https://plugin-md-enhance.vuejs.press/guide/content/revealjs/demo.html",
24
+ },
21
25
  ],
22
26
  });
@@ -1,9 +1,7 @@
1
1
  import { hopeTheme } from "vuepress-theme-hope";
2
2
  import navbar from "./navbar.js";
3
3
  import sidebar from "./sidebar.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>';
4
+ import { MR_HOPE_AVATAR } from "./logo.js";
7
5
 
8
6
  export default hopeTheme({
9
7
  hostname: "https://mister-hope.github.io",
@@ -80,94 +78,101 @@ export default hopeTheme({
80
78
  editLink: "Edit this page on GitHub",
81
79
  },
82
80
 
81
+ // enable it to preview all changes in time
82
+ // hotReload: true,
83
+
83
84
  plugins: {
84
85
  blog: true,
85
86
 
86
- // install @waline/client before enabling it
87
- // WARNING: This is a test server for demo only.
88
- // You should create and use your own comment service in production.
87
+ // Install @waline/client before enabling it
88
+ // Note: This is for testing ONLY!
89
+ // You MUST generate and use your own comment service in production.
89
90
  // comment: {
90
91
  // provider: "Waline",
91
92
  // serverURL: "https://waline-comment.vuejs.press",
92
93
  // },
93
94
 
94
- // all features are enabled for demo, only preserve features you need here
95
+ components: {
96
+ components: ["Badge", "VPCard"],
97
+ },
98
+
99
+ // These features are enabled for demo, only preserve features you need here
95
100
  mdEnhance: {
96
101
  align: true,
97
102
  attrs: true,
103
+ codetabs: true,
104
+ component: true,
105
+ demo: true,
106
+ figure: true,
107
+ imgLazyload: true,
108
+ imgSize: true,
109
+ include: true,
110
+ mark: true,
111
+ plantuml: true,
112
+ spoiler: true,
113
+ stylize: [
114
+ {
115
+ matcher: "Recommended",
116
+ replacer: ({ tag }) => {
117
+ if (tag === "em")
118
+ return {
119
+ tag: "Badge",
120
+ attrs: { type: "tip" },
121
+ content: "Recommended",
122
+ };
123
+ },
124
+ },
125
+ ],
126
+ sub: true,
127
+ sup: true,
128
+ tabs: true,
129
+ tasklist: true,
130
+ vPre: true,
98
131
 
99
132
  // install chart.js before enabling it
100
133
  // chart: true,
101
134
 
102
- codetabs: true,
103
-
104
135
  // insert component easily
105
- // component: true,
106
-
107
- demo: true,
108
136
 
109
137
  // install echarts before enabling it
110
138
  // echarts: true,
111
139
 
112
- figure: true,
113
-
114
140
  // install flowchart.ts before enabling it
115
141
  // flowchart: true,
116
142
 
117
143
  // gfm requires mathjax-full to provide tex support
118
144
  // gfm: true,
119
145
 
120
- imgLazyload: true,
121
- imgSize: true,
122
- include: true,
123
-
124
146
  // install katex before enabling it
125
147
  // katex: true,
126
148
 
127
149
  // install mathjax-full before enabling it
128
150
  // mathjax: true,
129
151
 
130
- mark: true,
131
-
132
152
  // install mermaid before enabling it
133
153
  // mermaid: true,
134
154
 
135
- playground: {
136
- presets: ["ts", "vue"],
137
- },
155
+ // playground: {
156
+ // presets: ["ts", "vue"],
157
+ // },
138
158
 
139
159
  // install reveal.js before enabling it
140
160
  // revealJs: {
141
161
  // plugins: ["highlight", "math", "search", "notes", "zoom"],
142
162
  // },
143
163
 
144
- stylize: [
145
- {
146
- matcher: "Recommended",
147
- replacer: ({ tag }) => {
148
- if (tag === "em")
149
- return {
150
- tag: "Badge",
151
- attrs: { type: "tip" },
152
- content: "Recommended",
153
- };
154
- },
155
- },
156
- ],
157
- sub: true,
158
- sup: true,
159
- tabs: true,
160
- vPre: true,
161
-
162
164
  // install @vue/repl before enabling it
163
165
  // vuePlayground: true,
166
+
167
+ // install sandpack-vue3 before enabling it
168
+ // sandpack: true,
164
169
  },
165
170
 
166
- // uncomment these if you want a PWA
171
+ // install @vuepress/plugin-pwa and uncomment these if you want a PWA
167
172
  // pwa: {
168
173
  // favicon: "/favicon.ico",
169
174
  // cacheHTML: true,
170
- // cachePic: true,
175
+ // cacheImage: true,
171
176
  // appendBase: true,
172
177
  // apple: {
173
178
  // icon: "/assets/icon/apple-icon-152.png",
@@ -2,6 +2,7 @@ import { navbar } from "vuepress-theme-hope";
2
2
 
3
3
  export const enNavbar = navbar([
4
4
  "/",
5
+ "/portfolio",
5
6
  "/demo/",
6
7
  {
7
8
  text: "Posts",
@@ -2,6 +2,7 @@ import { navbar } from "vuepress-theme-hope";
2
2
 
3
3
  export const zhNavbar = navbar([
4
4
  "/zh/",
5
+ "/zh/portfolio",
5
6
  "/zh/demo/",
6
7
  {
7
8
  text: "博文",
@@ -17,6 +17,10 @@ export const enSidebar = sidebar({
17
17
  children: "structure",
18
18
  },
19
19
  "intro",
20
- "slides",
20
+ {
21
+ text: "Slides",
22
+ icon: "person-chalkboard",
23
+ link: "https://plugin-md-enhance.vuejs.press/guide/content/revealjs/demo.html",
24
+ },
21
25
  ],
22
26
  });
@@ -17,6 +17,10 @@ export const zhSidebar = sidebar({
17
17
  children: "structure",
18
18
  },
19
19
  "intro",
20
- "slides",
20
+ {
21
+ text: "幻灯片",
22
+ icon: "person-chalkboard",
23
+ link: "https://plugin-md-enhance.vuejs.press/zh/guide/content/revealjs/demo.html",
24
+ },
21
25
  ],
22
26
  });
@@ -1,9 +1,7 @@
1
1
  import { hopeTheme } from "vuepress-theme-hope";
2
2
  import { enNavbar, zhNavbar } from "./navbar/index.js";
3
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>';
4
+ import { MR_HOPE_AVATAR } from "./logo.js";
7
5
 
8
6
  export default hopeTheme({
9
7
  hostname: "https://mister-hope.github.io",
@@ -113,94 +111,101 @@ export default hopeTheme({
113
111
  },
114
112
  },
115
113
 
114
+ // enable it to preview all changes in time
115
+ // hotReload: true,
116
+
116
117
  plugins: {
117
118
  blog: true,
118
119
 
119
- // install @waline/client before enabling it
120
- // WARNING: This is a test server for demo only.
121
- // You should create and use your own comment service in production.
120
+ // Install @waline/client before enabling it
121
+ // Note: This is for testing ONLY!
122
+ // You MUST generate and use your own comment service in production.
122
123
  // comment: {
123
124
  // provider: "Waline",
124
125
  // serverURL: "https://waline-comment.vuejs.press",
125
126
  // },
126
127
 
127
- // all features are enabled for demo, only preserve features you need here
128
+ components: {
129
+ components: ["Badge", "VPCard"],
130
+ },
131
+
132
+ // These features are enabled for demo, only preserve features you need here
128
133
  mdEnhance: {
129
134
  align: true,
130
135
  attrs: true,
136
+ codetabs: true,
137
+ component: true,
138
+ demo: true,
139
+ figure: true,
140
+ imgLazyload: true,
141
+ imgSize: true,
142
+ include: true,
143
+ mark: true,
144
+ plantuml: true,
145
+ spoiler: true,
146
+ stylize: [
147
+ {
148
+ matcher: "Recommended",
149
+ replacer: ({ tag }) => {
150
+ if (tag === "em")
151
+ return {
152
+ tag: "Badge",
153
+ attrs: { type: "tip" },
154
+ content: "Recommended",
155
+ };
156
+ },
157
+ },
158
+ ],
159
+ sub: true,
160
+ sup: true,
161
+ tabs: true,
162
+ tasklist: true,
163
+ vPre: true,
131
164
 
132
165
  // install chart.js before enabling it
133
166
  // chart: true,
134
167
 
135
- codetabs: true,
136
-
137
168
  // insert component easily
138
- // component: true,
139
-
140
- demo: true,
141
169
 
142
170
  // install echarts before enabling it
143
171
  // echarts: true,
144
172
 
145
- figure: true,
146
-
147
173
  // install flowchart.ts before enabling it
148
174
  // flowchart: true,
149
175
 
150
176
  // gfm requires mathjax-full to provide tex support
151
177
  // gfm: true,
152
178
 
153
- imgLazyload: true,
154
- imgSize: true,
155
- include: true,
156
-
157
179
  // install katex before enabling it
158
180
  // katex: true,
159
181
 
160
182
  // install mathjax-full before enabling it
161
183
  // mathjax: true,
162
184
 
163
- mark: true,
164
-
165
185
  // install mermaid before enabling it
166
186
  // mermaid: true,
167
187
 
168
- playground: {
169
- presets: ["ts", "vue"],
170
- },
188
+ // playground: {
189
+ // presets: ["ts", "vue"],
190
+ // },
171
191
 
172
192
  // install reveal.js before enabling it
173
193
  // revealJs: {
174
194
  // plugins: ["highlight", "math", "search", "notes", "zoom"],
175
195
  // },
176
196
 
177
- stylize: [
178
- {
179
- matcher: "Recommended",
180
- replacer: ({ tag }) => {
181
- if (tag === "em")
182
- return {
183
- tag: "Badge",
184
- attrs: { type: "tip" },
185
- content: "Recommended",
186
- };
187
- },
188
- },
189
- ],
190
- sub: true,
191
- sup: true,
192
- tabs: true,
193
- vPre: true,
194
-
195
197
  // install @vue/repl before enabling it
196
198
  // vuePlayground: true,
199
+
200
+ // install sandpack-vue3 before enabling it
201
+ // sandpack: true,
197
202
  },
198
203
 
199
- // uncomment these if you want a PWA
204
+ // install @vuepress/plugin-pwa and uncomment these if you want a PWA
200
205
  // pwa: {
201
206
  // favicon: "/favicon.ico",
202
207
  // cacheHTML: true,
203
- // cachePic: true,
208
+ // cacheImage: true,
204
209
  // appendBase: true,
205
210
  // apple: {
206
211
  // icon: "/assets/icon/apple-icon-152.png",
@@ -10,6 +10,6 @@ export default defineUserConfig({
10
10
 
11
11
  theme,
12
12
 
13
- // Enable it with pwa
13
+ // 和 PWA 一起启用
14
14
  // shouldPrefetch: false,
15
15
  });