From 1a2a06a124b6d8aa742df0271814e0dc321436f2 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 2 Feb 2024 09:42:24 +0800 Subject: [PATCH 1/8] docs: update package description --- plugins/plugin-auto-frontmatter/package.json | 5 +++-- plugins/plugin-baidu-tongji/package.json | 5 +++-- plugins/plugin-blog-data/package.json | 5 +++-- plugins/plugin-blog-data/src/shared/index.ts | 4 +++- plugins/plugin-caniuse/package.json | 3 ++- plugins/plugin-content-update/package.json | 5 +++-- plugins/plugin-copy-code/package.json | 5 +++-- plugins/plugin-iconify/package.json | 5 +++-- plugins/plugin-netlify-functions/package.json | 3 ++- plugins/plugin-notes-data/package.json | 5 +++-- 10 files changed, 28 insertions(+), 17 deletions(-) diff --git a/plugins/plugin-auto-frontmatter/package.json b/plugins/plugin-auto-frontmatter/package.json index 776bb065..4cb3eb20 100644 --- a/plugins/plugin-auto-frontmatter/package.json +++ b/plugins/plugin-auto-frontmatter/package.json @@ -2,13 +2,14 @@ "name": "@vuepress-plume/plugin-auto-frontmatter", "type": "module", "version": "1.0.0-rc.30", - "description": "The Plugin for VuePres 2", + "description": "The Plugin for VuePres 2 - auto frontmatter", "author": "pengzhanbo ", "license": "MIT", "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-auto-frontmatter" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" diff --git a/plugins/plugin-baidu-tongji/package.json b/plugins/plugin-baidu-tongji/package.json index bc9d8d83..2cde277e 100644 --- a/plugins/plugin-baidu-tongji/package.json +++ b/plugins/plugin-baidu-tongji/package.json @@ -2,13 +2,14 @@ "name": "@vuepress-plume/plugin-baidu-tongji", "type": "module", "version": "1.0.0-rc.30", - "description": "The Plugin for VuePres 2", + "description": "The Plugin for VuePres 2 - baidu tongji", "author": "pengzhanbo (https://github.com/pengzhanbo/)", "license": "MIT", "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-baidu-tongji" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" diff --git a/plugins/plugin-blog-data/package.json b/plugins/plugin-blog-data/package.json index f5fdfad2..5cc11f19 100644 --- a/plugins/plugin-blog-data/package.json +++ b/plugins/plugin-blog-data/package.json @@ -2,13 +2,14 @@ "name": "@vuepress-plume/plugin-blog-data", "type": "module", "version": "1.0.0-rc.30", - "description": "The Plugin for VuePres 2", + "description": "The Plugin for VuePres 2 - blog data", "author": "pengzhanbo ", "license": "MIT", "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-blog-data" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" diff --git a/plugins/plugin-blog-data/src/shared/index.ts b/plugins/plugin-blog-data/src/shared/index.ts index 86af918c..1ef0a0ba 100644 --- a/plugins/plugin-blog-data/src/shared/index.ts +++ b/plugins/plugin-blog-data/src/shared/index.ts @@ -5,8 +5,10 @@ export interface BlogDataPluginOptions { exclude?: string | string[] sortBy?: 'createTime' | false | ((prev: T, next: T) => boolean) excerpt?: boolean - extendBlogData?: (page: T) => Record + extendBlogData?: (page: T, extra: Record) => Record pageFilter?: (page: Page) => boolean + + extraBlogData?: (extra: Record) => void } export type BlogPostData = BlogPostDataItem[] diff --git a/plugins/plugin-caniuse/package.json b/plugins/plugin-caniuse/package.json index 71264482..f4407e75 100644 --- a/plugins/plugin-caniuse/package.json +++ b/plugins/plugin-caniuse/package.json @@ -8,7 +8,8 @@ "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-caniuse" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" diff --git a/plugins/plugin-content-update/package.json b/plugins/plugin-content-update/package.json index 698d1c6c..750c6ecc 100644 --- a/plugins/plugin-content-update/package.json +++ b/plugins/plugin-content-update/package.json @@ -2,13 +2,14 @@ "name": "@vuepress-plume/plugin-content-update", "type": "module", "version": "1.0.0-rc.30", - "description": "The Plugin for VuePres 2", + "description": "The Plugin for VuePres 2 - content update", "author": "pengzhanbo ", "license": "MIT", "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-content-update" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" diff --git a/plugins/plugin-copy-code/package.json b/plugins/plugin-copy-code/package.json index 3adfdd4d..3a958ad8 100644 --- a/plugins/plugin-copy-code/package.json +++ b/plugins/plugin-copy-code/package.json @@ -2,13 +2,14 @@ "name": "@vuepress-plume/plugin-copy-code", "type": "module", "version": "1.0.0-rc.30", - "description": "The Plugin for VuePres 2", + "description": "The Plugin for VuePres 2 - copy code", "author": "pengzhanbo ", "license": "MIT", "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-copy-code" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" diff --git a/plugins/plugin-iconify/package.json b/plugins/plugin-iconify/package.json index 83ae1a86..7afd7156 100644 --- a/plugins/plugin-iconify/package.json +++ b/plugins/plugin-iconify/package.json @@ -2,13 +2,14 @@ "name": "@vuepress-plume/plugin-iconify", "type": "module", "version": "1.0.0-rc.30", - "description": "The Plugin for VuePres 2", + "description": "The Plugin for VuePres 2 - iconify", "author": "pengzhanbo ", "license": "MIT", "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-iconify" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" diff --git a/plugins/plugin-netlify-functions/package.json b/plugins/plugin-netlify-functions/package.json index d264537c..5b13e554 100644 --- a/plugins/plugin-netlify-functions/package.json +++ b/plugins/plugin-netlify-functions/package.json @@ -8,7 +8,8 @@ "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-netlify-functions" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" diff --git a/plugins/plugin-notes-data/package.json b/plugins/plugin-notes-data/package.json index f243b7d8..91a5c62c 100644 --- a/plugins/plugin-notes-data/package.json +++ b/plugins/plugin-notes-data/package.json @@ -2,13 +2,14 @@ "name": "@vuepress-plume/plugin-notes-data", "type": "module", "version": "1.0.0-rc.30", - "description": "The Plugin for VuePres 2", + "description": "The Plugin for VuePres 2 - notes data", "author": "pengzhanbo ", "license": "MIT", "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-notes-data" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" From 9952a3fd8506846cde0dc57e0bf557d4727d1e38 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 2 Feb 2024 09:44:26 +0800 Subject: [PATCH 2/8] feat: bump and rename `shiki` --- plugins/plugin-shikiji/package.json | 9 +- plugins/plugin-shikiji/src/node/index.ts | 4 +- .../plugin-shikiji/src/node/shikijiPlugin.ts | 4 +- plugins/plugin-shikiji/src/node/types.ts | 12 +- pnpm-lock.yaml | 200 ++++++++++-------- 5 files changed, 123 insertions(+), 106 deletions(-) diff --git a/plugins/plugin-shikiji/package.json b/plugins/plugin-shikiji/package.json index 715baab2..c188cca8 100644 --- a/plugins/plugin-shikiji/package.json +++ b/plugins/plugin-shikiji/package.json @@ -8,7 +8,8 @@ "homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme", "repository": { "type": "git", - "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git" + "url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git", + "directory": "plugins/plugin-shikiji" }, "bugs": { "url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues" @@ -35,11 +36,11 @@ "vuepress": "2.0.0-rc.2" }, "dependencies": { - "@shikijs/transformers": "1.0.0-beta.0", - "@shikijs/twoslash": "1.0.0-beta.0", + "@shikijs/transformers": "1.0.0-beta.3", + "@shikijs/twoslash": "1.0.0-beta.3", "nanoid": "^5.0.4", "picocolors": "^1.0.0", - "shiki": "1.0.0-beta.0" + "shiki": "1.0.0-beta.3" }, "publishConfig": { "access": "public" diff --git a/plugins/plugin-shikiji/src/node/index.ts b/plugins/plugin-shikiji/src/node/index.ts index 6aca3b80..228e2bdb 100644 --- a/plugins/plugin-shikiji/src/node/index.ts +++ b/plugins/plugin-shikiji/src/node/index.ts @@ -1,6 +1,6 @@ -import { shikijiPlugin } from './shikijiPlugin.js' +import { shikiPlugin } from './shikijiPlugin.js' export * from './shikijiPlugin.js' export * from './types.js' -export default shikijiPlugin +export default shikiPlugin diff --git a/plugins/plugin-shikiji/src/node/shikijiPlugin.ts b/plugins/plugin-shikiji/src/node/shikijiPlugin.ts index 49a76a70..91254c08 100644 --- a/plugins/plugin-shikiji/src/node/shikijiPlugin.ts +++ b/plugins/plugin-shikiji/src/node/shikijiPlugin.ts @@ -2,9 +2,9 @@ import type { Plugin } from 'vuepress/core' import { highlight } from './highlight.js' import type { HighlighterOptions } from './types' -export type ShikijiPluginOptions = HighlighterOptions +export type ShikiPluginOptions = HighlighterOptions -export function shikijiPlugin(options: ShikijiPluginOptions = {}): Plugin { +export function shikiPlugin(options: ShikiPluginOptions = {}): Plugin { return { name: '@vuepress-plume/plugin-shikiji', diff --git a/plugins/plugin-shikiji/src/node/types.ts b/plugins/plugin-shikiji/src/node/types.ts index 091f1de2..7195ca3c 100644 --- a/plugins/plugin-shikiji/src/node/types.ts +++ b/plugins/plugin-shikiji/src/node/types.ts @@ -20,13 +20,17 @@ export interface HighlighterOptions { * * You can also pass an object with `light` and `dark` themes to support dual themes. * + * You can use an existing theme. + * + * @see https://shiki.style/themes + * + * Or add your own theme. + * + * @see https://shiki.style/guide/load-theme + * * @example { theme: 'github-dark' } * @example { theme: { light: 'github-light', dark: 'github-dark' } } * - * You can use an existing theme. - * @see https://shiki.style/themes - * Or add your own theme. - * @see https://shiki.style/guide/load-theme */ theme?: ThemeOptions /** diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27110e95..8ca26ea5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -280,11 +280,11 @@ importers: plugins/plugin-shikiji: dependencies: '@shikijs/transformers': - specifier: 1.0.0-beta.0 - version: 1.0.0-beta.0 + specifier: 1.0.0-beta.3 + version: 1.0.0-beta.3 '@shikijs/twoslash': - specifier: 1.0.0-beta.0 - version: 1.0.0-beta.0(typescript@5.3.3) + specifier: 1.0.0-beta.3 + version: 1.0.0-beta.3(typescript@5.3.3) nanoid: specifier: ^5.0.4 version: 5.0.4 @@ -292,8 +292,8 @@ importers: specifier: ^1.0.0 version: 1.0.0 shiki: - specifier: 1.0.0-beta.0 - version: 1.0.0-beta.0 + specifier: 1.0.0-beta.3 + version: 1.0.0-beta.3 vuepress: specifier: 2.0.0-rc.2 version: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) @@ -331,38 +331,44 @@ importers: specifier: workspace:* version: link:../plugins/plugin-shikiji '@vuepress/plugin-active-header-links': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vuepress/plugin-container': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(vuepress@2.0.0-rc.2) '@vuepress/plugin-docsearch': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(@algolia/client-search@4.20.0)(search-insights@2.7.0)(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(@algolia/client-search@4.20.0)(search-insights@2.7.0)(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vuepress/plugin-external-link-icon': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vuepress/plugin-git': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(vuepress@2.0.0-rc.2) '@vuepress/plugin-medium-zoom': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vuepress/plugin-nprogress': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vuepress/plugin-palette': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(vuepress@2.0.0-rc.2) '@vuepress/plugin-search': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2) + '@vuepress/plugin-seo': + specifier: 2.0.0-rc.6 + version: 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) + '@vuepress/plugin-sitemap': + specifier: 2.0.0-rc.6 + version: 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vuepress/plugin-theme-data': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vuepress/plugin-toc': - specifier: 2.0.0-rc.1 - version: 2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.3 + version: 2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vueuse/core': specifier: ^10.7.2 version: 10.7.2(vue@3.4.15) @@ -396,12 +402,6 @@ importers: vuepress-plugin-reading-time2: specifier: 2.0.0-rc.16 version: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) - vuepress-plugin-seo2: - specifier: 2.0.0-rc.16 - version: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) - vuepress-plugin-sitemap2: - specifier: 2.0.0-rc.16 - version: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) packages: @@ -3059,20 +3059,20 @@ packages: dev: false optional: true - /@shikijs/core@1.0.0-beta.0: - resolution: {integrity: sha512-uicyrkx379Q5sxQuGV3kduHPWIAkjxmeA5A4J6syscx8wiEyIV06i/Q6s9GeKLCb857Hi90H8e/FoFSbcjnZsw==} + /@shikijs/core@1.0.0-beta.3: + resolution: {integrity: sha512-SCwPom2Wn8XxNlEeqdzycU93SKgzYeVsedjqDsgZaz4XiiPpZUzlHt2NAEQTwTnPcHNZapZ6vbkwJ8P11ggL3Q==} dev: false - /@shikijs/transformers@1.0.0-beta.0: - resolution: {integrity: sha512-OvIO6RxQ7YaQhp34uXVKUPZDRdTcGwBgX3zn26haSvqPwrTQcxdPgT47sr4u3sz1+RwN3RO9AGxCJFRKNpB+Qw==} + /@shikijs/transformers@1.0.0-beta.3: + resolution: {integrity: sha512-ASQQQqxW4dANxMGw4yGkTjtMSsUaRhImv/lzJEdfJ3/eP8TVlVYnohOFQVgpLjBBYGy9P0l0oKrlbjiGosTJ/Q==} dependencies: - shiki: 1.0.0-beta.0 + shiki: 1.0.0-beta.3 dev: false - /@shikijs/twoslash@1.0.0-beta.0(typescript@5.3.3): - resolution: {integrity: sha512-zil9WA4aCs2yJ+1vwt1El8+xp8up9ikh48ksTl7Un8/+dHDAVKjkRD20W+G071cl7NOEEWEynnIMkqqVITNlfA==} + /@shikijs/twoslash@1.0.0-beta.3(typescript@5.3.3): + resolution: {integrity: sha512-lHksLOuWNaU5rZsbJ3ViBn3U8P5f+CGKIcPDuggNczEAyT/nT1CFAHSusE08lJSclAFTNHIkEUE4btUUkxx3Wg==} dependencies: - '@shikijs/core': 1.0.0-beta.0 + '@shikijs/core': 1.0.0-beta.3 twoslash: 0.1.0(typescript@5.3.3) transitivePeerDependencies: - supports-color @@ -4036,6 +4036,22 @@ packages: - typescript dev: false + /@vuepress/helper@2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-Q4NzyrlZ0ZgEboo7HtrQiXBBLf3EEsqqQLeMFzTcTlDujxkh0Erxp+o1LCWr4wFno3sO6W7OCjM2HeUTiZ5NGQ==} + engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} + peerDependencies: + vuepress: 2.0.0-rc.2 + dependencies: + '@vue/shared': 3.4.15 + cheerio: 1.0.0-rc.12 + fflate: 0.8.1 + gray-matter: 4.0.3 + vue: 3.4.15(typescript@5.3.3) + vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) + transitivePeerDependencies: + - typescript + dev: false + /@vuepress/markdown@2.0.0-rc.2(patch_hash=wvnafiipiin2b7vjmkvdw5vom4): resolution: {integrity: sha512-5/RmJnap+MGKxDhSO+Mv6zB8PoPHhhBujnNKKO3PnyfPrj0LyL0AuTm8m3Ea271wMp9956WINjw8jlpn+Z1sBg==} dependencies: @@ -4060,8 +4076,8 @@ packages: dev: false patched: true - /@vuepress/plugin-active-header-links@2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-Ra5exai0mWH9uihzoVH8pje9XXll8zcICmDilTaYhir+KFw1VvKUFGLxLlEXuAMc06K4i25To2BzUVyce1Fijg==} + /@vuepress/plugin-active-header-links@2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-ddr8VIrYA/kpWGWx80GeWclSvQoYR9QjXvkx//AMbl5mQqX70GTZrgv5Rbnp6MC8mBxVg6Izy/9eqaJELE+A3g==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4073,8 +4089,8 @@ packages: - typescript dev: false - /@vuepress/plugin-container@2.0.0-rc.1(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-60dPvy5u/qp0siE3MWAP/HU+FXKcTzml3/pQRuP1aBEiscUKW1DTD+2KpVT/wC3afHH2yAqDFaxKrVV5dC4+Zw==} + /@vuepress/plugin-container@2.0.0-rc.3(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-wwwtQQYiA21JKKYM4TCjDWxS2p91RPiv62NoWp+Q6BG+E+qnwaA1sOrd36CsEOS2IbIcJdBeHY/zskL0aWKEoQ==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4084,8 +4100,8 @@ packages: vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) dev: false - /@vuepress/plugin-docsearch@2.0.0-rc.1(@algolia/client-search@4.20.0)(search-insights@2.7.0)(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-oawNWGYm4JIeRH6o97muiHQVG+JvFPLX7v5LGD7N4uUm92GYJXIlLqzJer7jekkHhq7VigSWqvXFybCqI2R53w==} + /@vuepress/plugin-docsearch@2.0.0-rc.3(@algolia/client-search@4.20.0)(search-insights@2.7.0)(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-3kf05fviNAahFXNLCOcQEgn/cjJLshCEf6oiezA8Jr6ABj6Q38Ky+nFjX/AjCaoWsyiG4BfbRRxuqxYvsDEimQ==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4107,8 +4123,8 @@ packages: - typescript dev: false - /@vuepress/plugin-external-link-icon@2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-6zGt5qAnPn+sFJdOpSYAQfq/OV8vRfynTfwtSZVU0QiLVk1GDTTssGjZ32GKxmPPilXF0tiSMTcITfFllnNUmA==} + /@vuepress/plugin-external-link-icon@2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-DX4Dn2uj2rAEausB2tz5fe/Ra3oR/B9uR67+yG2lQzZqcZZDW5txsXpZaM0FkXHijzNoS4NKP7k/7qNVe5WvcQ==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4118,8 +4134,8 @@ packages: - typescript dev: false - /@vuepress/plugin-git@2.0.0-rc.1(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-k3bS/wxJ5xpxg2Hzy7FEaskpYTKohazP+Dg6z7GUI+rnxfh6H+pMeIWXg/eTTqTC6Zbq1+pNfzuYvZ64GMHpQw==} + /@vuepress/plugin-git@2.0.0-rc.3(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-BQoDWmksC+aSc5V933OuNeU7mfrP4hryhckIFadAhKLVRl6CSXDb96SGVTBxcO1gIgKzItdE67UzMw4T9JJN6A==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4127,8 +4143,8 @@ packages: vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) dev: false - /@vuepress/plugin-medium-zoom@2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-5d19cu5z0adXf/HDqFHYcM2dBMlBgK90CAr7YnKgj/nmv2dl6bQ2AtHENUNxOx35c4F3TGgvit9fl+MIaQmrVg==} + /@vuepress/plugin-medium-zoom@2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-qRdUt914tQGfmxcqOwnoC6paZLsAJf2S7kllvf59dDKIDg2JlYsAuOq13wps4/hfuUySe9RDlitl6KcqWfvKfw==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4139,8 +4155,8 @@ packages: - typescript dev: false - /@vuepress/plugin-nprogress@2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-omCUxzWrOrm0c45+0MENY65mUWh+VmUAhckEqQir3waE9Ql7wD4drZ/fdUyfgHarBjSzdSCB6QguQMLwt9OOQw==} + /@vuepress/plugin-nprogress@2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-UkbMLvkRps56KF2fsIXtJ0ylRacuPRW9qA1PYwq7XkDqNr4FE5aZsnRHuYIMPUxuhU5t3hRx/zeKOwbctzd2Yw==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4151,8 +4167,8 @@ packages: - typescript dev: false - /@vuepress/plugin-palette@2.0.0-rc.1(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-oe/lTE/qcb2lTF3KqQbX/k8oyitM9fo7sKiodPpjxQtjh4cee3BeQhDSNS5NjajDDcj950WBS6gRD6ha5JuuRw==} + /@vuepress/plugin-palette@2.0.0-rc.3(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-BCP2SMEPmaqg4/oHsfA7lpp79iQDZvgeGQCYyWRP2aB5LZ2IiFdyRfZMFOUVzbetsqX7ciOFX3ELG9U59lCOjw==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4160,8 +4176,8 @@ packages: vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) dev: false - /@vuepress/plugin-search@2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-zON1YS6udFcDFox/ypbFWNGdpQEDvku/wjlVnwlwBiuhyjWZsjMUIBypjjJx5Q3barWhpPCFJA43YBYCpieTcA==} + /@vuepress/plugin-search@2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-dTxOYKPNziWX2vx+RO0PLwj/auABlCCAZT42wQt65R5y5RBA7eptFlqF/jmRXKG+CPvSMUOrIo1FrCTvB3yFig==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4173,8 +4189,31 @@ packages: - typescript dev: false - /@vuepress/plugin-theme-data@2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-PaVGCY4wsaFFUgue4b7yK5lGoQk4PTx6WwukbTR4cbRqY9kxX2Abpgp5EDoRBrcRbNzt85DV9voMQJr3Vx/BIg==} + /@vuepress/plugin-seo@2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-MIzt1V4wnp5EYBvRt6W54+poguKf2w2YRpyDNa3DkjM/rhrjfSsD7EYP7syp4gzwnIDoxUP3pnENh1mYY9g9bQ==} + peerDependencies: + vuepress: 2.0.0-rc.2 + dependencies: + '@vuepress/helper': 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) + vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) + transitivePeerDependencies: + - typescript + dev: false + + /@vuepress/plugin-sitemap@2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-yvRSTADF9RHa6JzFeIAxY0BP7wKy+F+naig9BgE0ushC4IQkpjh3VrBtdXhlRKzSMGlLfgmc2kezsObvjvz31w==} + peerDependencies: + vuepress: 2.0.0-rc.2 + dependencies: + '@vuepress/helper': 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) + sitemap: 7.1.1 + vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) + transitivePeerDependencies: + - typescript + dev: false + + /@vuepress/plugin-theme-data@2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-Uiso+0b2sIaHtPVftjpCEIT+/T4/E9ZpTCL0fnUEa8APnrP7SiIBqph7+KZENvXGg+0B5+MtZROOfFksFfMyFw==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -4185,8 +4224,8 @@ packages: - typescript dev: false - /@vuepress/plugin-toc@2.0.0-rc.1(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-LbhSRNUrKu94ERtTBa/H741LiXDDtM9Hye69DkB89Fl1g50WQiMV+txIRV84qMC8yHHN+ho0DgcDwJdaV1qCfg==} + /@vuepress/plugin-toc@2.0.0-rc.3(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-cxlJ1iaIHBVEWjZvhYBgZxZTlgQ+1F7xxG13htnn35vVxzflNrqCIXHA54+FDsITHn2T5ATCES90tyywZ6mrbw==} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: @@ -13178,10 +13217,10 @@ packages: /shell-quote@1.8.1: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} - /shiki@1.0.0-beta.0: - resolution: {integrity: sha512-CcP0IhEDQ3LWfJC44cfxfId9pjJi9Nephl8DxgrL4tKWprI/oz6deZyL0vB+XWxhTx/1uonzWQKaSQPwKx5dTA==} + /shiki@1.0.0-beta.3: + resolution: {integrity: sha512-z7cHTNSSvwGx2DfeLwjSNLo+HcVxifgNIzLm6Ye52eXcIwNHXT0wHbhy7FDOKSKveuEHBwt9opfj3Hoc8LE1Yg==} dependencies: - '@shikijs/core': 1.0.0-beta.0 + '@shikijs/core': 1.0.0-beta.3 dev: false /side-channel@1.0.4: @@ -15015,33 +15054,6 @@ packages: - typescript dev: false - /vuepress-plugin-seo2@2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-WGtoaR98chMiq6C14rmtRNHC9XVS0fSqSOeti6b1k8SjW6ESTmILq5o0vp4Vojc0Qo5DA/nN7Cw0cLaKVVgX8A==} - engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} - peerDependencies: - vuepress: 2.0.0-rc.2 - dependencies: - vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) - vuepress-shared: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) - transitivePeerDependencies: - - '@vue/composition-api' - - typescript - dev: false - - /vuepress-plugin-sitemap2@2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-7hGlrwACCSZijuGFyc4Yh+3IXh8f9dFK0iekjlMbC2TxNbDHHmsLHnsGfEmd6H1xsQtaTC1fwXw158jiXwE1fA==} - engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} - peerDependencies: - vuepress: 2.0.0-rc.2 - dependencies: - sitemap: 7.1.1 - vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) - vuepress-shared: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) - transitivePeerDependencies: - - '@vue/composition-api' - - typescript - dev: false - /vuepress-shared@2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2): resolution: {integrity: sha512-gsiqo9tr6dHCVQTPw1d+oiJyNGzc6nmrGRBWkLb3ZxD15q1k/iv2flBwPdb1RasU827oMgZ2DuOzbHcGjRKjSA==} engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} From 5f280420ef272a09c573fcb4bc7c1406162b7f6b Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 2 Feb 2024 09:46:10 +0800 Subject: [PATCH 3/8] =?UTF-8?q?feat(plugin-blog-data):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=94=AF=E6=8C=81=E7=94=9F=E6=88=90=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E7=9A=84=E5=8D=9A=E5=AE=A2=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/theme.ts | 4 +++- .../src/client/blogPostData.d.ts | 3 ++- .../src/client/composables/useBlogPostData.ts | 16 +++++++++++++++- .../src/node/prepareBlogData.ts | 18 +++++++++++++++--- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/.vuepress/theme.ts b/docs/.vuepress/theme.ts index 4297e650..ab688ba6 100644 --- a/docs/.vuepress/theme.ts +++ b/docs/.vuepress/theme.ts @@ -1,8 +1,9 @@ import themePlume from 'vuepress-theme-plume' +import type { Theme } from 'vuepress' import { enNotes, zhNotes } from './notes.js' import { enNavbar, zhNavbar } from './navbar.js' -export const theme = themePlume({ +export const theme: Theme = themePlume({ logo: 'https://pengzhanbo.cn/g.gif', hostname: 'https://pengzhanbo.cn', repo: 'https://github.com/pengzhanbo/vuepress-theme-plume', @@ -15,6 +16,7 @@ export const theme = themePlume({ }, social: [{ icon: 'github', link: 'https://github.com/pengzhanbo' }], + footer: { copyright: 'Copyright © 2022-present pengzhanbo' }, locales: { diff --git a/plugins/plugin-blog-data/src/client/blogPostData.d.ts b/plugins/plugin-blog-data/src/client/blogPostData.d.ts index 52fa5598..abda7c79 100644 --- a/plugins/plugin-blog-data/src/client/blogPostData.d.ts +++ b/plugins/plugin-blog-data/src/client/blogPostData.d.ts @@ -2,6 +2,7 @@ import type { BlogPostData } from '../shared/index.js' declare module '@internal/blogData' { const blogPostData: BlogPostData + const extraBlogData: Record - export { blogPostData } + export { blogPostData, extraBlogData } } diff --git a/plugins/plugin-blog-data/src/client/composables/useBlogPostData.ts b/plugins/plugin-blog-data/src/client/composables/useBlogPostData.ts index f146b15a..29df8ec3 100644 --- a/plugins/plugin-blog-data/src/client/composables/useBlogPostData.ts +++ b/plugins/plugin-blog-data/src/client/composables/useBlogPostData.ts @@ -1,4 +1,7 @@ -import { blogPostData as blogPostDataRaw } from '@internal/blogData' +import { + blogPostData as blogPostDataRaw, + extraBlogData as extraBlogDataRaw, +} from '@internal/blogData' import { ref } from 'vue' import type { Ref } from 'vue' import type { BlogPostData } from '../../shared/index.js' @@ -15,8 +18,19 @@ export function useBlogPostData< return blogPostData as BlogDataRef } +export type ExtraBlogDataRef = Ref> + +export const extraBlogData: ExtraBlogDataRef = ref(extraBlogDataRaw) + +export function useExtraBlogData(): ExtraBlogDataRef { + return extraBlogData as ExtraBlogDataRef +} + if (__VUEPRESS_DEV__ && (import.meta.webpackHot || import.meta.hot)) { __VUE_HMR_RUNTIME__.updateBlogData = (data: BlogPostData) => { blogPostData.value = data } + __VUE_HMR_RUNTIME__.updateExtraBlogData = (data: Record) => { + extraBlogData.value = data + } } diff --git a/plugins/plugin-blog-data/src/node/prepareBlogData.ts b/plugins/plugin-blog-data/src/node/prepareBlogData.ts index e712ab69..ec19139d 100644 --- a/plugins/plugin-blog-data/src/node/prepareBlogData.ts +++ b/plugins/plugin-blog-data/src/node/prepareBlogData.ts @@ -8,11 +8,15 @@ if (import.meta.webpackHot) { if (__VUE_HMR_RUNTIME__.updateBlogData) { __VUE_HMR_RUNTIME__.updateBlogData(blogPostData) } + if (__VUE_HMR_RUNTIME__.updateExtraBlogData) { + __VUE_HMR_RUNTIME__.updateExtraBlogData(extraBlogData) + } } if (import.meta.hot) { - import.meta.hot.accept(({ blogPostData }) => { + import.meta.hot.accept(({ blogPostData, extraBlogData }) => { __VUE_HMR_RUNTIME__.updateBlogData(blogPostData) + __VUE_HMR_RUNTIME__.updateExtraBlogData(extraBlogData) }) } ` @@ -47,10 +51,15 @@ export async function preparedBlogData(app: App, pageFilter: (id: string) => boo }) } + const extraBlogData: Record = {} + + if (typeof options.extraBlogData === 'function') + options.extraBlogData(extraBlogData) + const blogData: BlogPostData = pages.map((page: Page) => { let extended: Partial = {} if (typeof options.extendBlogData === 'function') - extended = options.extendBlogData(page) + extended = options.extendBlogData(page, extraBlogData) const data = { path: page.path, @@ -69,7 +78,10 @@ export async function preparedBlogData(app: App, pageFilter: (id: string) => boo let content = `\ export const blogPostData = JSON.parse(${JSON.stringify( JSON.stringify(blogData), - )}) + )}); +export const extraBlogData = JSON.parse(${JSON.stringify( + JSON.stringify(extraBlogData), +)}); ` // inject HMR code From 15c1f52b2749854850b4fe66f9fb5f3ec81613ba Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 2 Feb 2024 09:59:56 +0800 Subject: [PATCH 4/8] =?UTF-8?q?perf:=20=E4=BD=BF=E7=94=A8=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=8F=92=E4=BB=B6=E6=9B=BF=E6=8D=A2=20seo=E3=80=81sit?= =?UTF-8?q?emap=20=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pnpm-lock.yaml | 54 +++++++++++++++++++++++----------------------- theme/package.json | 32 +++++++++++++-------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ca26ea5..fd804260 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -394,14 +394,14 @@ importers: specifier: 2.0.0-rc.2 version: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) vuepress-plugin-comment2: - specifier: 2.0.0-rc.16 - version: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.18 + version: 2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2) vuepress-plugin-md-enhance: - specifier: 2.0.0-rc.16 - version: 2.0.0-rc.16(katex@0.16.9)(markdown-it@14.0.0)(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.18 + version: 2.0.0-rc.18(katex@0.16.9)(markdown-it@14.0.0)(typescript@5.3.3)(vuepress@2.0.0-rc.2) vuepress-plugin-reading-time2: - specifier: 2.0.0-rc.16 - version: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) + specifier: 2.0.0-rc.18 + version: 2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2) packages: @@ -13698,10 +13698,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: false - /striptags@3.2.0: - resolution: {integrity: sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw==} - dev: false - /strtok3@7.0.0: resolution: {integrity: sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==} engines: {node: '>=14.16'} @@ -14902,8 +14898,8 @@ packages: typescript: 5.3.3 dev: false - /vuepress-plugin-comment2@2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-uZD31oDfEPNrJYG2tuxHI8g3HBVLlbOtiOoZljs9RGCaKqup+MLsSIBNKg/P2uzLkfKybVIUZaTvAEH+QazYeg==} + /vuepress-plugin-comment2@2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-iSCX6aYsf2e6YwzMdygekixARdRPixkgDlFDzDpQTuyr5wdsdp+nMSAS6F4uYtKXFzZgASagbfBMjzN9JLT+Zg==} engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} peerDependencies: '@waline/client': ^2.15.8 || ^3.0.0-alpha.11 @@ -14921,19 +14917,20 @@ packages: twikoo: optional: true dependencies: + '@vuepress/helper': 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) giscus: 1.4.0 vue: 3.4.15(typescript@5.3.3) vue-router: 4.2.5(vue@3.4.15) vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) - vuepress-plugin-sass-palette: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) - vuepress-shared: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) + vuepress-plugin-sass-palette: 2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2) + vuepress-shared: 2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2) transitivePeerDependencies: - '@vue/composition-api' - typescript dev: false - /vuepress-plugin-md-enhance@2.0.0-rc.16(katex@0.16.9)(markdown-it@14.0.0)(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-3XfVUnTBoOk7c77LLZ79keQm2cKVZmGEEggOwpLnmZDr/qZQ5KFDqE1U0OturUwF/tfiyTB8Z9phpuuJ52u6lg==} + /vuepress-plugin-md-enhance@2.0.0-rc.18(katex@0.16.9)(markdown-it@14.0.0)(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-smn8Uagbhyeim+JtOeOdSMio+YXHhHk3RXRjj1z7PLFkY7zcY44v/BvChUDeWV/I4/aaOGWashmSud0Hi1Cs0g==} engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} peerDependencies: '@types/reveal.js': ^4.4.5 @@ -15006,6 +15003,7 @@ packages: '@mdit/plugin-tex': 0.8.0(markdown-it@14.0.0) '@mdit/plugin-uml': 0.8.0(markdown-it@14.0.0) '@types/markdown-it': 13.0.7 + '@vuepress/helper': 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vueuse/core': 10.7.2(vue@3.4.15) balloon-css: 1.2.0 js-yaml: 4.1.0 @@ -15013,30 +15011,31 @@ packages: vue: 3.4.15(typescript@5.3.3) vue-router: 4.2.5(vue@3.4.15) vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) - vuepress-plugin-sass-palette: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) - vuepress-shared: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) + vuepress-plugin-sass-palette: 2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2) + vuepress-shared: 2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2) transitivePeerDependencies: - '@vue/composition-api' - markdown-it - typescript dev: false - /vuepress-plugin-reading-time2@2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-7XzyyoR/qV/3an6KWl91+NSBIhSn10HbIXDG7AnblS5aVVz8FHRJPtnmJryVRVIPZNwIk8QSfnczR3GVwbaSyg==} + /vuepress-plugin-reading-time2@2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-Sj245CYGo0F5Axz6JN6nslcvyZ+1HtfraIPC7MNfPzJgOR/Tc6JKtQcNZhgyCL3aKx1wevs8T7X/nCeTToArsQ==} engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: + '@vuepress/helper': 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) vue: 3.4.15(typescript@5.3.3) vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) - vuepress-shared: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) + vuepress-shared: 2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2) transitivePeerDependencies: - '@vue/composition-api' - typescript dev: false - /vuepress-plugin-sass-palette@2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-fwhCSarn19JO8xGR+AIRsFkRVrbwOqjKwUB9XmTdTLqKCT5onvBZkjBrd2b47Zs+BhySL5nsuIW4H2tDwfFqBw==} + /vuepress-plugin-sass-palette@2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-DYmHANdKkz+jwAU7dpP72NYjPGOpWrY/2eTs4NPDDBNKELcav5W6oDM4T9gPGpk9kncEW8LC4NTS6z2Jkep2Ig==} engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} peerDependencies: sass-loader: ^14.0.0 @@ -15045,21 +15044,23 @@ packages: sass-loader: optional: true dependencies: + '@vuepress/helper': 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) chokidar: 3.5.3 sass: 1.70.0 vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) - vuepress-shared: 2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2) + vuepress-shared: 2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2) transitivePeerDependencies: - '@vue/composition-api' - typescript dev: false - /vuepress-shared@2.0.0-rc.16(typescript@5.3.3)(vuepress@2.0.0-rc.2): - resolution: {integrity: sha512-gsiqo9tr6dHCVQTPw1d+oiJyNGzc6nmrGRBWkLb3ZxD15q1k/iv2flBwPdb1RasU827oMgZ2DuOzbHcGjRKjSA==} + /vuepress-shared@2.0.0-rc.18(typescript@5.3.3)(vuepress@2.0.0-rc.2): + resolution: {integrity: sha512-oFY8hWYrMQHQMe+YKZvjfzdHK/wvghyhWa4IJuLBwRm6j9AhXOJEAvSzQQKpERkpGS4vZ+pY5tWAodfv2Fhztw==} engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} peerDependencies: vuepress: 2.0.0-rc.2 dependencies: + '@vuepress/helper': 2.0.0-rc.6(typescript@5.3.3)(vuepress@2.0.0-rc.2) '@vueuse/core': 10.7.2(vue@3.4.15) cheerio: 1.0.0-rc.12 dayjs: 1.11.10 @@ -15067,7 +15068,6 @@ packages: fflate: 0.8.1 gray-matter: 4.0.3 semver: 7.5.4 - striptags: 3.2.0 vue: 3.4.15(typescript@5.3.3) vue-router: 4.2.5(vue@3.4.15) vuepress: 2.0.0-rc.2(@vuepress/bundler-vite@2.0.0-rc.2)(@vuepress/bundler-webpack@2.0.0-rc.2)(typescript@5.3.3)(vue@3.4.15) diff --git a/theme/package.json b/theme/package.json index ec351f46..35b05b09 100644 --- a/theme/package.json +++ b/theme/package.json @@ -65,17 +65,19 @@ "@vuepress-plume/plugin-iconify": "workspace:*", "@vuepress-plume/plugin-notes-data": "workspace:*", "@vuepress-plume/plugin-shikiji": "workspace:*", - "@vuepress/plugin-active-header-links": "2.0.0-rc.1", - "@vuepress/plugin-container": "2.0.0-rc.1", - "@vuepress/plugin-docsearch": "2.0.0-rc.1", - "@vuepress/plugin-external-link-icon": "2.0.0-rc.1", - "@vuepress/plugin-git": "2.0.0-rc.1", - "@vuepress/plugin-medium-zoom": "2.0.0-rc.1", - "@vuepress/plugin-nprogress": "2.0.0-rc.1", - "@vuepress/plugin-palette": "2.0.0-rc.1", - "@vuepress/plugin-search": "2.0.0-rc.1", - "@vuepress/plugin-theme-data": "2.0.0-rc.1", - "@vuepress/plugin-toc": "2.0.0-rc.1", + "@vuepress/plugin-active-header-links": "2.0.0-rc.3", + "@vuepress/plugin-container": "2.0.0-rc.3", + "@vuepress/plugin-docsearch": "2.0.0-rc.3", + "@vuepress/plugin-external-link-icon": "2.0.0-rc.3", + "@vuepress/plugin-git": "2.0.0-rc.3", + "@vuepress/plugin-medium-zoom": "2.0.0-rc.3", + "@vuepress/plugin-nprogress": "2.0.0-rc.3", + "@vuepress/plugin-palette": "2.0.0-rc.3", + "@vuepress/plugin-search": "2.0.0-rc.3", + "@vuepress/plugin-seo": "2.0.0-rc.6", + "@vuepress/plugin-sitemap": "2.0.0-rc.6", + "@vuepress/plugin-theme-data": "2.0.0-rc.3", + "@vuepress/plugin-toc": "2.0.0-rc.3", "@vueuse/core": "^10.7.2", "date-fns": "^3.3.1", "katex": "^0.16.9", @@ -83,10 +85,8 @@ "nanoid": "^5.0.4", "vue": "^3.4.15", "vue-router": "4.2.5", - "vuepress-plugin-comment2": "2.0.0-rc.16", - "vuepress-plugin-md-enhance": "2.0.0-rc.16", - "vuepress-plugin-reading-time2": "2.0.0-rc.16", - "vuepress-plugin-seo2": "2.0.0-rc.16", - "vuepress-plugin-sitemap2": "2.0.0-rc.16" + "vuepress-plugin-comment2": "2.0.0-rc.18", + "vuepress-plugin-md-enhance": "2.0.0-rc.18", + "vuepress-plugin-reading-time2": "2.0.0-rc.18" } } From c1e0c854f675ede733c042146c141f72a2efa384 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 2 Feb 2024 10:34:58 +0800 Subject: [PATCH 5/8] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E5=BD=92=E6=A1=A3=E9=A1=B5=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- theme/src/client/components/Archives.vue | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/theme/src/client/components/Archives.vue b/theme/src/client/components/Archives.vue index c9ad6caf..7bdbf90d 100644 --- a/theme/src/client/components/Archives.vue +++ b/theme/src/client/components/Archives.vue @@ -63,4 +63,36 @@ const { archives } = useArchives() font-size: 18px; font-weight: 700; } + +@media (min-width: 768px) { + .archives-wrapper { + padding: 32px 0; + margin-left: 20px; + } + + .archives-title { + display: none; + } + + .archive { + padding: 20px; + margin-bottom: 24px; + background-color: var(--vp-c-bg); + border-bottom: none; + border-radius: 8px; + box-shadow: var(--vp-shadow-2); + } + + .archive-title { + padding-bottom: 10px; + margin-top: 0; + border-bottom: solid 1px var(--vp-c-divider); + } +} + +@media (min-width: 960px) { + .archives-wrapper { + margin-left: auto; + } +} From 8d56e989d4c236c43017a62b7b52ef93e012496f Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 2 Feb 2024 10:35:27 +0800 Subject: [PATCH 6/8] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E6=A0=87=E7=AD=BE=E9=A1=B5=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- theme/src/client/components/Tags.vue | 96 +++++++++++++++++++--------- 1 file changed, 66 insertions(+), 30 deletions(-) diff --git a/theme/src/client/components/Tags.vue b/theme/src/client/components/Tags.vue index 963bbca2..5fb0e872 100644 --- a/theme/src/client/components/Tags.vue +++ b/theme/src/client/components/Tags.vue @@ -9,29 +9,33 @@ const { tags: tagsLink } = useBlogExtract() @@ -39,7 +43,7 @@ const { tags: tagsLink } = useBlogExtract() .tags-wrapper { flex: 1; max-width: 768px; - padding: 32px 24px 168px; + padding: 32px 24px; margin: 0 auto; } @@ -53,7 +57,7 @@ const { tags: tagsLink } = useBlogExtract() margin-bottom: 20px; font-size: 20px; font-weight: 700; - color: var(--vp-c-brand-1); + color: var(--vp-c-text-1); } .tags-title .icon { @@ -72,14 +76,16 @@ const { tags: tagsLink } = useBlogExtract() .tags .tag { display: flex; align-items: center; - padding: 6px 6px 6px 10px; - margin: 8px; + padding: 6px 10px 6px 12px; + margin: 6px; + font-size: 14px; line-height: 1; - color: var(--vp-tag-color); + color: var(--vp-c-bg); word-wrap: break-word; cursor: pointer; + background-color: var(--vp-tag-color); border: solid 1px var(--vp-tag-color); - border-radius: 4px; + border-radius: 6px; transition: all var(--t-color); } @@ -95,20 +101,50 @@ const { tags: tagsLink } = useBlogExtract() display: inline-block; padding-left: 6px; margin-left: 4px; - color: var(--vp-tag-color); - border-left: 1px solid var(--vp-tag-color); + color: var(--vp-c-bg); + border-left: 1px solid var(--vp-c-bg); transition: all var(--t-color); } .tags .tag:hover, .tags .tag.active { color: var(--vp-c-bg); - background-color: var(--vp-tag-color); + background-color: var(--vp-tag-hover-color); } .tags .tag:hover .tag-count, .tags .tag.active .tag-count { - color: var(--vp-bg); + color: var(--vp-c-bg); border-left-color: var(--vp-c-divider); } + +@media (min-width: 768px) { + .tags-wrapper { + padding: 32px 0; + margin-left: 20px; + } + + .tags-nav, + .tags-container { + padding: 20px; + background-color: var(--vp-c-bg); + border-radius: 8px; + box-shadow: var(--vp-shadow-2); + } + + .tags-container { + margin-top: 24px; + margin-bottom: 24px; + } + + .tags-container .tag-title { + margin-top: 0; + } +} + +@media (min-width: 960px) { + .tags-wrapper { + margin-left: auto; + } +} From 8a969abb27df963c54a266144d6748dd2d2f7d71 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Fri, 2 Feb 2024 10:36:44 +0800 Subject: [PATCH 7/8] =?UTF-8?q?perf:=20=E6=94=B9=E7=89=88=E5=8D=9A?= =?UTF-8?q?=E5=AE=A2=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8=E9=A1=B5UI?= =?UTF-8?q?=EF=BC=8C=E8=B4=B4=E5=90=88=E8=AE=BE=E8=AE=A1=E8=B6=8B=E5=8A=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- theme/src/client/components/BackToTop.vue | 5 +- theme/src/client/components/Blog.vue | 34 +++++- theme/src/client/components/BlogAside.vue | 110 +++++++++++++----- theme/src/client/components/Flyout/index.vue | 2 +- theme/src/client/components/Friends.vue | 7 ++ .../client/components/Nav/NavBarMenuLink.vue | 2 +- theme/src/client/components/PageMeta.vue | 30 +++-- theme/src/client/components/PostItem.vue | 46 +++++++- theme/src/client/components/PostList.vue | 1 + theme/src/client/components/VFooter.vue | 17 ++- .../components/icons/IconChevronRight.vue | 1 + theme/src/client/composables/blog.ts | 26 ++++- theme/src/client/composables/readingTime.ts | 4 +- theme/src/client/styles/vars.scss | 1 - theme/src/client/utils/index.ts | 1 - theme/src/node/blogTags.ts | 40 +++++++ theme/src/node/plugins.ts | 36 +++--- theme/src/shared/options/locale.ts | 4 + theme/src/shared/options/plugins.ts | 10 +- 19 files changed, 291 insertions(+), 86 deletions(-) create mode 100644 theme/src/node/blogTags.ts diff --git a/theme/src/client/components/BackToTop.vue b/theme/src/client/components/BackToTop.vue index 1752c5d7..c8600f5a 100644 --- a/theme/src/client/components/BackToTop.vue +++ b/theme/src/client/components/BackToTop.vue @@ -77,8 +77,8 @@ function handleClick() { .back-to-top-button { position: fixed; inset-inline-end: 1rem; - right: 20px; - bottom: 64px; + right: 24px; + bottom: calc(var(--vp-footer-height, 82px) - 18px); z-index: var(--vp-z-index-back-to-top); width: 36px; height: 36px; @@ -140,6 +140,7 @@ function handleClick() { @media (min-width: 768px) { .back-to-top-button { + bottom: calc(var(--vp-footer-height, 88px) - 24px); width: 48px; height: 48px; } diff --git a/theme/src/client/components/Blog.vue b/theme/src/client/components/Blog.vue index 0688ce61..4cf21ca9 100644 --- a/theme/src/client/components/Blog.vue +++ b/theme/src/client/components/Blog.vue @@ -12,16 +12,22 @@ const page = usePageData() diff --git a/theme/src/client/components/Flyout/index.vue b/theme/src/client/components/Flyout/index.vue index b2f7bbc0..96aa49f5 100644 --- a/theme/src/client/components/Flyout/index.vue +++ b/theme/src/client/components/Flyout/index.vue @@ -129,7 +129,7 @@ export default { display: flex; align-items: center; height: var(--vp-nav-height); - padding: 0 12px; + padding: 0 10px; color: var(--vp-c-text-1); transition: color 0.5s; } diff --git a/theme/src/client/components/Friends.vue b/theme/src/client/components/Friends.vue index 33b115b0..482b9f03 100644 --- a/theme/src/client/components/Friends.vue +++ b/theme/src/client/components/Friends.vue @@ -45,11 +45,18 @@ const list = computed(() => matter.value.list || [])