create-vuepress-theme-plume 1.0.0-rc.100

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 (34) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +14 -0
  3. package/bin/index.js +2 -0
  4. package/lib/index.d.ts +2 -0
  5. package/lib/index.js +531 -0
  6. package/package.json +43 -0
  7. package/templates/.vuepress/client.ts.handlebars +12 -0
  8. package/templates/.vuepress/config.ts.handlebars +90 -0
  9. package/templates/.vuepress/navbar.ts.handlebars +28 -0
  10. package/templates/.vuepress/notes.ts.handlebars +32 -0
  11. package/templates/.vuepress/plume.config.ts.handlebars +57 -0
  12. package/templates/.vuepress/public/plume.svg +8 -0
  13. package/templates/.vuepress/theme/components/Custom.vue +11 -0
  14. package/templates/.vuepress/theme/shim.d.ts +6 -0
  15. package/templates/.vuepress/theme/styles/custom.css +50 -0
  16. package/templates/common/README.md.handlebars +57 -0
  17. package/templates/common/README.zh-CN.md.handlebars +57 -0
  18. package/templates/deploy/github/.github/workflows/deploy.yml.handlebars +79 -0
  19. package/templates/deploy/netlify/netlify.toml.handlebars +9 -0
  20. package/templates/deploy/vercel/vercel.json.handlebars +6 -0
  21. package/templates/docs/en/README.md.handlebars +22 -0
  22. package/templates/docs/en/notes/demo/README.md +6 -0
  23. package/templates/docs/en/notes/demo/bar.md +5 -0
  24. package/templates/docs/en/notes/demo/foo.md +5 -0
  25. package/templates/docs/en/preview/custom-component.example.md +8 -0
  26. package/templates/docs/en/preview/markdown.md +312 -0
  27. package/templates/docs/zh/README.md.handlebars +22 -0
  28. package/templates/docs/zh/notes/demo/README.md +6 -0
  29. package/templates/docs/zh/notes/demo/bar.md +5 -0
  30. package/templates/docs/zh/notes/demo/foo.md +5 -0
  31. package/templates/docs/zh/preview/custom-component.example.md +8 -0
  32. package/templates/docs/zh/preview/markdown.md +312 -0
  33. package/templates/git/.gitattributes.handlebars +10 -0
  34. package/templates/git/.gitignore.handlebars +8 -0
@@ -0,0 +1,90 @@
1
+ import { defineUserConfig } from 'vuepress'
2
+ import { {{ bundler }}Bundler } from '@vuepress/bundler-{{ bundler }}'
3
+ import { plumeTheme } from 'vuepress-theme-plume'
4
+
5
+ export default defineUserConfig({
6
+ base: '/',
7
+ lang: '{{ defaultLanguage }}',
8
+ {{#if multiLanguage}}
9
+ locales: {
10
+ {{#each locales}}
11
+ '{{ path }}': {
12
+ title: '{{ ../siteName }}',
13
+ lang: '{{ lang }}',
14
+ description: '{{ ../siteDescription }}',
15
+ },
16
+ {{/each}}
17
+ },
18
+ {{else}}
19
+ title: '{{ siteName }}',
20
+ description: '{{ siteDescription }}',
21
+ {{/if}}
22
+
23
+ bundler: {{ bundler }}Bundler(),
24
+
25
+ theme: plumeTheme({
26
+ // 添加您的部署域名
27
+ // hostname: 'https://your_site_url',
28
+
29
+ plugins: {
30
+ /**
31
+ * Shiki 代码高亮
32
+ * @see https://theme-plume.vuejs.press/config/plugins/code-highlight/
33
+ */
34
+ // shiki: {
35
+ // languages: ['shell', 'bash', 'typescript', 'javascript'],
36
+ // twoslash: true,
37
+ // },
38
+
39
+ /**
40
+ * markdown enhance
41
+ * @see https://theme-plume.vuejs.press/config/plugins/markdown-enhance/
42
+ */
43
+ markdownEnhance: {
44
+ demo: true,
45
+ // include: true,
46
+ // chart: true,
47
+ // echarts: true,
48
+ // mermaid: true,
49
+ // flowchart: true,
50
+ },
51
+
52
+ /**
53
+ * markdown power
54
+ * @see https://theme-plume.vuejs.press/config/plugin/markdown-power/
55
+ */
56
+ // markdownPower: {
57
+ // pdf: true,
58
+ // caniuse: true,
59
+ // plot: true,
60
+ // bilibili: true,
61
+ // youtube: true,
62
+ // icons: true,
63
+ // codepen: true,
64
+ // replit: true,
65
+ // codeSandbox: true,
66
+ // jsfiddle: true,
67
+ // repl: {
68
+ // go: true,
69
+ // rust: true,
70
+ // kotlin: true,
71
+ // },
72
+ // },
73
+
74
+ /**
75
+ * comments
76
+ * @see https://theme-plume.vuejs.press/guide/features/comments/
77
+ */
78
+ // comment: {
79
+ // provider: '', // "Artalk" | "Giscus" | "Twikoo" | "Waline"
80
+ // comment: true,
81
+ // repo: '',
82
+ // repoId: '',
83
+ // categoryId: '',
84
+ // mapping: 'pathname',
85
+ // reactionsEnabled: true,
86
+ // inputPosition: 'top',
87
+ // },
88
+ },
89
+ }),
90
+ })
@@ -0,0 +1,28 @@
1
+ import { defineNavbarConfig } from 'vuepress-theme-plume'
2
+
3
+ {{#if multiLanguage}}
4
+ {{#each locales}}
5
+ export const {{prefix}}Navbar = defineNavbarConfig([
6
+ { text: '{{#if isEn}}Home{{else}}首页{{/if}}', link: '{{ path }}' },
7
+ { text: '{{#if isEn}}Blog{{else}}博客{{/if}}', link: '{{ path }}blog/' },
8
+ { text: '{{#if isEn}}Tags{{else}}标签{{/if}}', link: '{{ path }}blog/tags/' },
9
+ { text: '{{#if isEn}}Archives{{else}}归档{{/if}}', link: '{{ path }}blog/archives/' },
10
+ {
11
+ text: '{{#if isEn}}Notes{{else}}笔记{{/if}}',
12
+ items: [{ text: '{{#if isEn}}Demo{{else}}示例{{/if}}', link: '{{ path }}notes/demo/README.md' }]
13
+ },
14
+ ])
15
+
16
+ {{/each}}
17
+ {{else}}
18
+ export const navbar = defineNavbarConfig([
19
+ { text: '{{#if isEn}}Home{{else}}首页{{/if}}', link: '/' },
20
+ { text: '{{#if isEn}}Blog{{else}}博客{{/if}}', link: '/blog/' },
21
+ { text: '{{#if isEn}}Tags{{else}}标签{{/if}}', link: '/blog/tags/' },
22
+ { text: '{{#if isEn}}Archives{{else}}归档{{/if}}', link: '/blog/archives/' },
23
+ {
24
+ text: '{{#if isEn}}Notes{{else}}笔记{{/if}}',
25
+ items: [{ text: '{{#if isEn}}Demo{{else}}示例{{/if}}', link: '/notes/demo/README.md' }]
26
+ },
27
+ ])
28
+ {{/if}}
@@ -0,0 +1,32 @@
1
+ import { defineNoteConfig, defineNotesConfig } from 'vuepress-theme-plume'
2
+
3
+ {{#if multiLanguage}}
4
+ {{#each locales}}
5
+ /* =================== locale: {{ lang }} ======================= */
6
+
7
+ const {{ prefix }}DemoNote = defineNoteConfig({
8
+ dir: 'demo',
9
+ link: '/demo',
10
+ sidebar: ['', 'foo', 'bar'],
11
+ })
12
+
13
+ export const {{ prefix }}Notes = defineNotesConfig({
14
+ dir: '{{ removeLeadingSlash path }}notes',
15
+ link: '{{ path }}',
16
+ notes: [{{ prefix }}DemoNote],
17
+ })
18
+
19
+ {{/each}}
20
+ {{else}}
21
+ const demoNote = defineNoteConfig({
22
+ dir: 'demo',
23
+ link: '/demo',
24
+ sidebar: ['', 'foo', 'bar'],
25
+ })
26
+
27
+ export const notes = defineNotesConfig({
28
+ dir: 'notes',
29
+ link: '/',
30
+ notes: [demoNote],
31
+ })
32
+ {{/if}}
@@ -0,0 +1,57 @@
1
+ import { defineThemeConfig } from 'vuepress-theme-plume'
2
+ {{#if multiLanguage}}
3
+ import { enNavbar, zhNavbar } from './navbar'
4
+ import { enNotes, zhNotes } from './notes'
5
+ {{else}}
6
+ import { navbar } from './navbar'
7
+ import { notes } from './notes'
8
+ {{/if}}
9
+
10
+ /**
11
+ * @see https://theme-plume.vuejs.press/config/basic/
12
+ */
13
+ export default defineThemeConfig({
14
+ logo: 'https://theme-plume.vuejs.press/plume.png',
15
+ // your git repo url
16
+ docsRepo: '',
17
+ docsDir: '{{ docsDir }}',
18
+
19
+ appearance: true,
20
+
21
+ {{#unless multiLanguage}}
22
+ profile: {
23
+ avatar: 'https://theme-plume.vuejs.press/plume.png',
24
+ name: '{{ siteName }}',
25
+ description: '{{ siteDescription }}',
26
+ // circle: true,
27
+ // location: '',
28
+ // organization: '',
29
+ },
30
+
31
+ navbar,
32
+ notes,
33
+ {{/unless}}
34
+ social: [
35
+ { icon: 'github', link: '/' },
36
+ ],
37
+
38
+ {{#if multiLanguage}}
39
+ locales: {
40
+ {{#each locales}}
41
+ '{{ path }}': {
42
+ profile: {
43
+ avatar: 'https://theme-plume.vuejs.press/plume.png',
44
+ name: '{{ ../siteName }}',
45
+ description: '{{ ../siteDescription }}',
46
+ // circle: true,
47
+ // location: '',
48
+ // organization: '',
49
+ },
50
+
51
+ navbar: {{ prefix }}Navbar,
52
+ notes: {{ prefix }}Notes,
53
+ },
54
+ {{/each}}
55
+ },
56
+ {{/if}}
57
+ })
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 72 72">
2
+ <path fill="#5086a1" d="M42.334 49.147a29.945 29.945 0 0 1-19.338-8.151c-8.014-7.365-8.378-18.076-8.533-22.649l-.022-.627a2.904 2.904 0 0 1 3.457-2.951c17.005 3.355 21.695 16.324 22.056 17.4a49.543 49.543 0 0 1 3.574 15.922a1 1 0 0 1-.967 1.052c-.029.001-.106.004-.227.004" />
3
+ <path fill="#8cccd5" d="M44.436 55.316c-11.646 0-17.376-6.974-17.653-7.354a1 1 0 0 1 .262-1.424a11.103 11.103 0 0 1 12.774-1.574c-1.465-9.078 1.877-13.568 2.031-13.77a.998.998 0 0 1 .75-.39a.97.97 0 0 1 .78.325c8.944 9.771 8.793 16.532 7.908 19.691c-.034.14-1.062 4.092-4.772 4.406c-.711.062-1.405.09-2.08.09" />
4
+ <g fill="none" stroke="#333" stroke-linecap="round" stroke-linejoin="round" stroke-width="1">
5
+ <path d="M55.184 57.69S34.96 45.877 23.097 24.206m22.131 30.096c-11.93.46-17.628-6.88-17.628-6.88" />
6
+ <path d="M40.528 42.483c-.56-7.195 2.116-10.679 2.116-10.679c8.834 9.654 8.406 16.162 7.681 18.747m-13.311-3.129a30.15 30.15 0 0 1-13.341-7.162c-8.072-7.419-8.067-18.241-8.232-22.577a1.903 1.903 0 0 1 2.264-1.932C34.694 19.103 39.02 32.528 39.02 32.528" />
7
+ </g>
8
+ </svg>
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+
4
+ const message = ref('Hello World!')
5
+ </script>
6
+
7
+ <template>
8
+ <div class="my-custom-content">
9
+ {{ message }}
10
+ </div>
11
+ </template>
@@ -0,0 +1,6 @@
1
+ declare module '*.vue' {
2
+ import type { ComponentOptions } from 'vue'
3
+
4
+ const comp: ComponentOptions
5
+ export default comp
6
+ }
@@ -0,0 +1,50 @@
1
+ :root {
2
+ /** 主题颜色 */
3
+
4
+ /*
5
+ --vp-c-brand-1: #5086a1;
6
+ --vp-c-brand-2: #6aa1b7;
7
+ --vp-c-brand-3: #8cccd5;
8
+ --vp-c-brand-soft: rgba(131, 208, 218, 0.314);
9
+ */
10
+
11
+ /** 背景颜色 */
12
+
13
+ /*
14
+ --vp-c-bg: #fff;
15
+ --vp-c-bg-alt: #f6f6f7;
16
+ --vp-c-bg-elv: #fff;
17
+ --vp-c-bg-soft: #f6f6f7;
18
+ */
19
+
20
+ /** 文本颜色 */
21
+
22
+ /*
23
+ --vp-c-text-1: rgba(60, 60, 67);
24
+ --vp-c-text-2: rgba(60, 60, 67, 0.78);
25
+ --vp-c-text-3: rgba(60, 60, 67, 0.56);
26
+ */
27
+ }
28
+
29
+ /** 深色模式 */
30
+ .dark {
31
+ /*
32
+ --vp-c-brand-1: #8cccd5;
33
+ --vp-c-brand-2: #6aa1b7;
34
+ --vp-c-brand-3: #5086a1;
35
+ --vp-c-brand-soft: rgba(131, 208, 218, 0.314);
36
+ */
37
+
38
+ /*
39
+ --vp-c-bg: #1b1b1f;
40
+ --vp-c-bg-alt: #161618;
41
+ --vp-c-bg-elv: #202127;
42
+ --vp-c-bg-soft: #202127;
43
+ */
44
+
45
+ /*
46
+ --vp-c-text-1: rgba(255, 255, 245, 0.86);
47
+ --vp-c-text-2: rgba(235, 235, 245, 0.6);
48
+ --vp-c-text-3: rgba(235, 235, 245, 0.38);
49
+ */
50
+ }
@@ -0,0 +1,57 @@
1
+ # {{ name }}
2
+
3
+ The Site is generated using [vuepress](https://vuepress.vuejs.org/) and [vuepress-theme-plume](https://github.com/pengzhanbo/vuepress-theme-plume)
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ {{#if (equal packageManager "pnpm")}}
9
+ pnpm i
10
+ {{else if (equal packageManager "yarn")}}
11
+ yarn
12
+ {{else}}
13
+ npm i
14
+ {{/if}}
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ {{#if (equal packageManager "pnpm")}}
20
+ ```sh
21
+ # start dev server
22
+ pnpm docs:dev
23
+ # build for production
24
+ pnpm docs:build
25
+ # preview production build in local
26
+ pnpm docs:preview
27
+ # update vuepress and theme
28
+ pnpm vp-update
29
+ ```
30
+ {{else if (equal packageManager "yarn")}}
31
+ ```sh
32
+ # start dev server
33
+ yarn docs:dev
34
+ # build for production
35
+ yarn docs:build
36
+ # preview production build in local
37
+ yarn docs:preview
38
+ # update vuepress and theme
39
+ yarn vp-update
40
+ ```
41
+ {{else}}
42
+ ```sh
43
+ # start dev server
44
+ npm run docs:dev
45
+ # build for production
46
+ npm run docs:build
47
+ # preview production build in local
48
+ npm run docs:preview
49
+ # update vuepress and theme
50
+ npm run vp-update
51
+ ```
52
+ {{/if}}
53
+
54
+ ## Documents
55
+
56
+ - [vuepress](https://vuepress.vuejs.org/)
57
+ - [vuepress-theme-plume](https://theme-plume.vuejs.press/)
@@ -0,0 +1,57 @@
1
+ # {{ name }}
2
+
3
+ 网站使用 [vuepress](https://vuepress.vuejs.org/) 和 [vuepress-theme-plume](https://github.com/pengzhanbo/vuepress-theme-plume) 构建生成。
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ {{#if (equal packageManager "pnpm")}}
9
+ pnpm i
10
+ {{else if (equal packageManager "yarn")}}
11
+ yarn
12
+ {{else}}
13
+ npm i
14
+ {{/if}}
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ {{#if (equal packageManager "pnpm")}}
20
+ ```sh
21
+ # 启动开发服务
22
+ pnpm docs:dev
23
+ # 构建生产包
24
+ pnpm docs:build
25
+ # 本地预览生产服务
26
+ pnpm docs:preview
27
+ # 更新 vuepress 和主题
28
+ pnpm vp-update
29
+ ```
30
+ {{else if (equal packageManager "yarn")}}
31
+ ```sh
32
+ # 启动开发服务
33
+ yarn docs:dev
34
+ # 构建生产包
35
+ yarn docs:build
36
+ # 本地预览生产服务
37
+ yarn docs:preview
38
+ # update vuepress and theme
39
+ yarn vp-update
40
+ ```
41
+ {{else}}
42
+ ```sh
43
+ # 启动开发服务
44
+ npm run docs:dev
45
+ # 构建生产包
46
+ npm run docs:build
47
+ # 本地预览生产服务
48
+ npm run docs:preview
49
+ # 更新 vuepress 和主题
50
+ npm run vp-update
51
+ ```
52
+ {{/if}}
53
+
54
+ ## 文档
55
+
56
+ - [vuepress](https://vuepress.vuejs.org/)
57
+ - [vuepress-theme-plume](https://theme-plume.vuejs.press/)
@@ -0,0 +1,79 @@
1
+ name: deploy
2
+
3
+ on:
4
+ # 每当 push 到 main 分支时触发部署
5
+ # Deployment is triggered whenever a push is made to the main branch.
6
+ push:
7
+ branches: [main]
8
+ # 手动触发部署
9
+ # Manually trigger deployment
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ docs:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ with:
19
+ # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
20
+ # "Last updated time" and other git log-related information require fetching all commit records.
21
+ fetch-depth: 0
22
+
23
+ {{#if (equal packageManager "pnpm")}}
24
+ - name: Setup pnpm
25
+ uses: pnpm/action-setup@v4
26
+ {{/if}}
27
+ - name: Setup Node.js
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ # 选择要使用的 node 版本
31
+ node-version: 20
32
+
33
+ {{#if (equal packageManager "npm")}}
34
+ # 安装依赖
35
+ # Install dependencies
36
+ - name: Install Dependencies
37
+ run: npm ci
38
+ {{/if}}
39
+
40
+ {{#if (equal packageManager "pnpm")}}
41
+ # 安装依赖
42
+ # Install dependencies
43
+ - name: Install Dependencies
44
+ run: pnpm install --frozen-lockfile
45
+ {{/if}}
46
+
47
+ {{#if (equal packageManager "yarn")}}
48
+ - name: Run install
49
+ uses: borales/actions-yarn@v4
50
+ with:
51
+ cmd: install
52
+ {{/if}}
53
+
54
+ # 运行构建脚本
55
+ # Run the build script
56
+ {{#unless (equal packageManager "yarn")}}
57
+ - name: Build VuePress site
58
+ run: {{packageManager}} run docs:build
59
+ {{/unless}}
60
+ {{#if (equal packageManager "yarn")}}
61
+ - name: Build VuePress site
62
+ uses: borales/actions-yarn@v4
63
+ with:
64
+ cmd: docs:build
65
+ {{/if}}
66
+
67
+
68
+ # 查看 workflow 的文档来获取更多信息
69
+ # @see https://github.com/crazy-max/ghaction-github-pages
70
+ - name: Deploy to GitHub Pages
71
+ uses: crazy-max/ghaction-github-pages@v4
72
+ with:
73
+ # 部署到 gh-pages 分支
74
+ target_branch: gh-pages
75
+ # 部署目录为 VuePress 的默认输出目录
76
+ build_dir: {{docsDir}}/.vuepress/dist
77
+ env:
78
+ # @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
79
+ GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,9 @@
1
+ # prevent Netlify npm install
2
+
3
+ [build]
4
+ publish = "{{ docsDir }}/.vuepress/dist"
5
+ command = "{{#if (equal packageManager 'yarn')}}yarn && yarn{{else}}{{packageManager}} run{{/if}} docs:build"
6
+
7
+ [build.environment]
8
+ NODE_VERSION = "20"
9
+ NPM_FLAGS = "--version"
@@ -0,0 +1,6 @@
1
+ {
2
+ "framework": null,
3
+ "buildCommand": "{{#if (equal packageManager 'yarn')}}yarn{{else}}{{packageManager}} run{{/if}} docs:build",
4
+ "installCommand": "{{#if (equal packageManager 'yarn')}}yarn{{else}}{{packageManager}} install{{/if}}",
5
+ "outputDirectory": "{{ docsDir }}/.vuepress/dist"
6
+ }
@@ -0,0 +1,22 @@
1
+ ---
2
+ pageLayout: home
3
+ externalLinkIcon: false
4
+ config:
5
+ -
6
+ type: hero
7
+ full: true
8
+ background: tint-plate
9
+ hero:
10
+ name: Theme Plume
11
+ tagline: VuePress Next Theme
12
+ text: A simple, feature-rich, document & blog
13
+ actions:
14
+ -
15
+ theme: brand
16
+ text: Blog
17
+ link: {{#if (equal defaultLanguage 'en-US')}}/{{else}}/en/{{/if}}blog/
18
+ -
19
+ theme: alt
20
+ text: Github →
21
+ link: https://github.com/pengzhanbo/vuepress-theme-plume
22
+ ---
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: Demo
3
+ ---
4
+
5
+ - [bar](./bar.md)
6
+ - [foo](./foo.md)
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: bar
3
+ ---
4
+
5
+ [foo](./foo.md)
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: foo
3
+ ---
4
+
5
+ [bar](./bar.md)
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: Custom Component
3
+ tags:
4
+ - preview
5
+ - component
6
+ ---
7
+
8
+ <CustomComponent />