Merge pull request #36 from pengzhanbo/RC-12

RC-12
This commit is contained in:
pengzhanbo 2024-01-02 00:35:07 +08:00 committed by GitHub
commit 72f7e56577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 312 additions and 351 deletions

View File

@ -1,4 +1,5 @@
import * as path from 'path'
import * as path from 'node:path'
import process from 'node:process'
import { viteBundler } from '@vuepress/bundler-vite'
import { webpackBundler } from '@vuepress/bundler-webpack'
import { defineUserConfig } from '@vuepress/cli'

View File

@ -167,15 +167,25 @@ function foo() {
```
::: note 注释
注释内容
注释内容 [link](https://github.com/pengzhanbo) `inline code`
```js
const a = 1
const b = 2
const c = a + b
```
:::
::: info 信息
信息内容
信息内容 [link](https://github.com/pengzhanbo) `inline code`
```js
const a = 1
const b = 2
const c = a + b
```
:::
::: tip 提示
提示内容
提示内容 [link](https://github.com/pengzhanbo) `inline code`
```js
const a = 1
const b = 2
@ -184,7 +194,7 @@ const c = a + b
:::
::: warning 警告
警告内容
警告内容 [link](https://github.com/pengzhanbo) `inline code`
```js
const a = 1
const b = 2
@ -193,7 +203,7 @@ const c = a + b
:::
::: caution 错误
错误内容
错误内容 [link](https://github.com/pengzhanbo) `inline code`
```js
const a = 1
const b = 2
@ -202,7 +212,7 @@ const c = a + b
:::
::: important 重要
重要内容
重要内容 [link](https://github.com/pengzhanbo) `inline code`
```js
const a = 1
const b = 2
@ -210,14 +220,6 @@ const c = a + b
```
:::
::: info
代码
```ts
const a = 1
const b = 2
```
:::
**代码演示**

View File

@ -1,7 +1,7 @@
{
"name": "docs",
"private": true,
"type": "module",
"private": true,
"scripts": {
"docs:build": "vuepress-cli build --clean-cache",
"docs:clean": "rimraf .vuepress/.temp .vuepress/.cache .vuepress/dist",

View File

@ -2,9 +2,10 @@ import config from '@pengzhanbo/eslint-config-vue'
export default config({
formatters: {
css: false,
css: true,
html: true,
},
ignores: ['.temp', '.cache', 'lib', 'dist', 'docs', '**/*.html'],
ignores: ['lib', 'docs/**/*.md'],
globals: {
__VUEPRESS_VERSION__: 'readonly',
__VUEPRESS_BASE__: 'readonly',

View File

@ -40,7 +40,7 @@
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@pengzhanbo/eslint-config-vue": "^1.5.0",
"@pengzhanbo/eslint-config-vue": "^1.5.1",
"@types/minimist": "^1.2.5",
"@types/node": "20.9.1",
"@types/webpack-env": "^1.18.4",

View File

@ -15,7 +15,7 @@ export function useBlogPostData<
return blogPostData as BlogDataRef<T>
}
if (import.meta.webpackHot || import.meta.hot) {
if (__VUEPRESS_DEV__ && (import.meta.webpackHot || import.meta.hot)) {
__VUE_HMR_RUNTIME__.updateBlogData = (data: BlogPostData) => {
blogPostData.value = data
}

View File

@ -34,18 +34,11 @@ export function blogDataPlugin({
ignoreInitial: true,
})
watcher.on(
'add',
async () => await preparedBlogData(app, pageFilter, pluginOptions),
)
watcher.on(
'change',
async () => await preparedBlogData(app, pageFilter, pluginOptions),
)
watcher.on(
'unlink',
async () => await preparedBlogData(app, pageFilter, pluginOptions),
)
const handler = () => preparedBlogData(app, pageFilter, pluginOptions)
watcher.on('add', handler)
watcher.on('change', handler)
watcher.on('unlink', handler)
watchers.push(watcher)
},

View File

@ -33,10 +33,7 @@
"build": "pnpm run clean && pnpm run copy && pnpm run ts",
"clean": "rimraf lib *.tsbuildinfo",
"copy": "cpx \"src/**/*.{d.ts,vue,css,scss,jpg,png}\" lib",
"copy:watch": "cpx \"src/**/*.{d.ts,vue,css,scss,jpg,png}\" lib -w",
"dev": "concurrently \"pnpm copy:watch\" \"pnpm ts:watch\"",
"ts": "tsc -b tsconfig.build.json",
"ts:watch": "tsc -b tsconfig.build.json --watch"
"ts": "tsc -b tsconfig.build.json"
},
"dependencies": {
"@iconify/vue": "^4.1.1",

View File

@ -33,10 +33,7 @@
"build": "pnpm run clean && pnpm run copy && pnpm run ts",
"clean": "rimraf lib *.tsbuildinfo",
"copy": "cpx \"src/**/*.{d.ts,vue,css,scss,jpg,png}\" lib",
"copy:watch": "cpx \"src/**/*.{d.ts,vue,css,scss,jpg,png}\" lib -w",
"dev": "concurrently \"pnpm copy:watch\" \"pnpm ts:watch\"",
"ts": "tsc -b tsconfig.build.json",
"ts:watch": "tsc -b tsconfig.build.json --watch"
"ts": "tsc -b tsconfig.build.json"
},
"dependencies": {
"@vue/devtools-api": "^6.5.1",

View File

@ -15,7 +15,7 @@ export function useNotesData<
return notesData as NotesDataRef<T>
}
if (import.meta.webpackHot || import.meta.hot) {
if (__VUEPRESS_DEV__ && (import.meta.webpackHot || import.meta.hot)) {
__VUE_HMR_RUNTIME__.updateNotesData = (data: NotesData) => {
notesData.value = data
}

View File

@ -38,7 +38,7 @@
效果:
``` html
阅读数99
阅读数99
```
## 结构

View File

@ -36,8 +36,8 @@
"@vuepress/utils": "2.0.0-rc.0",
"nanoid": "^5.0.4",
"picocolors": "^1.0.0",
"shikiji": "^0.9.15",
"shikiji-transformers": "^0.9.15"
"shikiji": "^0.9.16",
"shikiji-transformers": "^0.9.16"
},
"publishConfig": {
"access": "public"

131
pnpm-lock.yaml generated
View File

@ -15,8 +15,8 @@ importers:
specifier: ^18.4.3
version: 18.4.3
'@pengzhanbo/eslint-config-vue':
specifier: ^1.5.0
version: 1.5.0(@vue/compiler-sfc@3.4.3)(eslint-plugin-format@0.1.0)(eslint@8.56.0)(typescript@5.3.3)
specifier: ^1.5.1
version: 1.5.1(@vue/compiler-sfc@3.4.3)(eslint-plugin-format@0.1.0)(eslint@8.56.0)(typescript@5.3.3)
'@types/minimist':
specifier: ^1.2.5
version: 1.2.5
@ -386,11 +386,11 @@ importers:
specifier: ^1.0.0
version: 1.0.0
shikiji:
specifier: ^0.9.15
version: 0.9.15
specifier: ^0.9.16
version: 0.9.16
shikiji-transformers:
specifier: ^0.9.15
version: 0.9.15
specifier: ^0.9.16
version: 0.9.16
theme:
dependencies:
@ -1983,18 +1983,6 @@ packages:
- supports-color
dev: false
/@html-eslint/eslint-plugin@0.22.0:
resolution: {integrity: sha512-6Q3uW5XeVmUGwH2t5lmt0q51x7dNiaV1GuYReuHOPn01tSn9vJ5OKs71t+OsQzhg+hUqpVrmBizkBJZkcpX/sA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@html-eslint/parser@0.22.0:
resolution: {integrity: sha512-1XNYNgysZJfpLEYx+ao4I67F5+8gQDQbBt38/Ylcn5L8ij5xHfRDWvOIBvejqEgNQRRzM5s7UOhPSj+02YtMsQ==}
engines: {node: '>=8.10.0'}
dependencies:
es-html-parser: 0.0.9
dev: true
/@humanwhocodes/config-array@0.11.13:
resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==}
engines: {node: '>=10.10.0'}
@ -3952,8 +3940,8 @@ packages:
'@parcel/watcher-win32-x64': 2.3.0
dev: false
/@pengzhanbo/eslint-config-vue@1.5.0(@vue/compiler-sfc@3.4.3)(eslint-plugin-format@0.1.0)(eslint@8.56.0)(typescript@5.3.3):
resolution: {integrity: sha512-DdzMN4QEOk7hc1uGHw9u8xymQPZbG92OkVV8KNpOqMSOcEU+1UdIN5TGbgJ8SUn1zpW+eozN1AY2k7dXOhkWGA==}
/@pengzhanbo/eslint-config-vue@1.5.1(@vue/compiler-sfc@3.4.3)(eslint-plugin-format@0.1.0)(eslint@8.56.0)(typescript@5.3.3):
resolution: {integrity: sha512-4+ERArSMd5ovP0etk1BcH/chIB7Z/JvG/LoBErTn9Xujdj+g9ANyCJA/JNxMRh88DbMmCRp2ho1+4/b82HTipw==}
peerDependencies:
'@unocss/eslint-plugin': '>=0.50.0'
eslint: '>=8.40.0'
@ -3964,7 +3952,7 @@ packages:
eslint-plugin-tailwindcss:
optional: true
dependencies:
'@pengzhanbo/eslint-config': 1.5.0(eslint-plugin-format@0.1.0)(eslint@8.56.0)(typescript@5.3.3)(vue-eslint-parser@9.3.2)
'@pengzhanbo/eslint-config': 1.5.1(eslint-plugin-format@0.1.0)(eslint@8.56.0)(typescript@5.3.3)(vue-eslint-parser@9.3.2)
'@typescript-eslint/parser': 6.16.0(eslint@8.56.0)(typescript@5.3.3)
eslint: 8.56.0
eslint-merge-processors: 0.1.0(eslint@8.56.0)
@ -3984,8 +3972,8 @@ packages:
- vitest
dev: true
/@pengzhanbo/eslint-config@1.5.0(eslint-plugin-format@0.1.0)(eslint@8.56.0)(typescript@5.3.3)(vue-eslint-parser@9.3.2):
resolution: {integrity: sha512-CaLMoRceGedgKmDRdWOJ8fzY1VUaRid9+mzrc7Fb4LHX24zyz7PMtNq7BVpz3ezEqV9e2CBoWLjL3j9sr+iojw==}
/@pengzhanbo/eslint-config@1.5.1(eslint-plugin-format@0.1.0)(eslint@8.56.0)(typescript@5.3.3)(vue-eslint-parser@9.3.2):
resolution: {integrity: sha512-tk1emthQHQnlwz76rwUFcmVB6r04QSJs8ekn7CdKSN3TekHjYDTvicfQaOq0n2Inmdj51Ha8Jri6bCU1cZ7oXg==}
peerDependencies:
'@unocss/eslint-plugin': '>=0.50.0'
eslint: '>=8.40.0'
@ -4003,8 +3991,6 @@ packages:
'@eslint-types/jsdoc': 46.9.0
'@eslint-types/typescript-eslint': 6.16.0
'@eslint-types/unicorn': 50.0.1
'@html-eslint/eslint-plugin': 0.22.0
'@html-eslint/parser': 0.22.0
'@stylistic/eslint-plugin': 1.5.1(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/parser': 6.16.0(eslint@8.56.0)(typescript@5.3.3)
@ -4015,7 +4001,7 @@ packages:
eslint-plugin-eslint-comments: 3.2.0(eslint@8.56.0)
eslint-plugin-format: 0.1.0(eslint@8.56.0)
eslint-plugin-i: 2.29.1(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)
eslint-plugin-jsdoc: 46.10.1(eslint@8.56.0)
eslint-plugin-jsdoc: 47.0.2(eslint@8.56.0)
eslint-plugin-jsonc: 2.11.2(eslint@8.56.0)
eslint-plugin-markdown: 3.0.1(eslint@8.56.0)
eslint-plugin-n: 16.6.0(eslint@8.56.0)
@ -4303,7 +4289,7 @@ packages:
peerDependencies:
eslint: '*'
dependencies:
'@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3)
eslint: 8.56.0
transitivePeerDependencies:
- supports-color
@ -4317,7 +4303,7 @@ packages:
eslint: '>=8.40.0'
dependencies:
'@stylistic/eslint-plugin-js': 1.5.1(eslint@8.56.0)
'@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3)
eslint: 8.56.0
transitivePeerDependencies:
- supports-color
@ -4736,14 +4722,6 @@ packages:
- supports-color
dev: true
/@typescript-eslint/scope-manager@6.15.0:
resolution: {integrity: sha512-+BdvxYBltqrmgCNu4Li+fGDIkW9n//NrruzG9X1vBzaNK+ExVXPoGB71kneaVw/Jp+4rH/vaMAGC6JfMbHstVg==}
engines: {node: ^16.0.0 || >=18.0.0}
dependencies:
'@typescript-eslint/types': 6.15.0
'@typescript-eslint/visitor-keys': 6.15.0
dev: true
/@typescript-eslint/scope-manager@6.16.0:
resolution: {integrity: sha512-0N7Y9DSPdaBQ3sqSCwlrm9zJwkpOuc6HYm7LpzLAPqBL7dmzAUimr4M29dMkOP/tEwvOCC/Cxo//yOfJD3HUiw==}
engines: {node: ^16.0.0 || >=18.0.0}
@ -4777,11 +4755,6 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: false
/@typescript-eslint/types@6.15.0:
resolution: {integrity: sha512-yXjbt//E4T/ee8Ia1b5mGlbNj9fB9lJP4jqLbZualwpP2BCQ5is6BcWwxpIsY4XKAhmdv3hrW92GdtJbatC6dQ==}
engines: {node: ^16.0.0 || >=18.0.0}
dev: true
/@typescript-eslint/types@6.16.0:
resolution: {integrity: sha512-hvDFpLEvTJoHutVl87+MG/c5C8I6LOgEx05zExTSJDEVU7hhR3jhV8M5zuggbdFCw98+HhZWPHZeKS97kS3JoQ==}
engines: {node: ^16.0.0 || >=18.0.0}
@ -4808,27 +4781,6 @@ packages:
- supports-color
dev: false
/@typescript-eslint/typescript-estree@6.15.0(typescript@5.3.3):
resolution: {integrity: sha512-7mVZJN7Hd15OmGuWrp2T9UvqR2Ecg+1j/Bp1jXUEY2GZKV6FXlOIoqVDmLpBiEiq3katvj/2n2mR0SDwtloCew==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/types': 6.15.0
'@typescript-eslint/visitor-keys': 6.15.0
debug: 4.3.4(supports-color@9.2.2)
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.4
ts-api-utils: 1.0.1(typescript@5.3.3)
typescript: 5.3.3
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/typescript-estree@6.16.0(typescript@5.3.3):
resolution: {integrity: sha512-VTWZuixh/vr7nih6CfrdpmFNLEnoVBF1skfjdyGnNwXOH1SLeHItGdZDHhhAIzd3ACazyY2Fg76zuzOVTaknGA==}
engines: {node: ^16.0.0 || >=18.0.0}
@ -4851,25 +4803,6 @@ packages:
- supports-color
dev: true
/@typescript-eslint/utils@6.15.0(eslint@8.56.0)(typescript@5.3.3):
resolution: {integrity: sha512-eF82p0Wrrlt8fQSRL0bGXzK5nWPRV2dYQZdajcfzOD9+cQz9O7ugifrJxclB+xVOvWvagXfqS4Es7vpLP4augw==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0)
'@types/json-schema': 7.0.12
'@types/semver': 7.5.0
'@typescript-eslint/scope-manager': 6.15.0
'@typescript-eslint/types': 6.15.0
'@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3)
eslint: 8.56.0
semver: 7.5.4
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/@typescript-eslint/utils@6.16.0(eslint@8.56.0)(typescript@5.3.3):
resolution: {integrity: sha512-T83QPKrBm6n//q9mv7oiSvy/Xq/7Hyw9SzSEhMHJwznEmQayfBM87+oAlkNAMEO7/MjIwKyOHgBJbxB0s7gx2A==}
engines: {node: ^16.0.0 || >=18.0.0}
@ -4897,14 +4830,6 @@ packages:
eslint-visitor-keys: 3.4.3
dev: false
/@typescript-eslint/visitor-keys@6.15.0:
resolution: {integrity: sha512-1zvtdC1a9h5Tb5jU9x3ADNXO9yjP8rXlaoChu0DQX40vf5ACVpYIVIZhIMZ6d5sDXH7vq4dsZBT1fEGj8D2n2w==}
engines: {node: ^16.0.0 || >=18.0.0}
dependencies:
'@typescript-eslint/types': 6.15.0
eslint-visitor-keys: 3.4.3
dev: true
/@typescript-eslint/visitor-keys@6.16.0:
resolution: {integrity: sha512-QSFQLruk7fhs91a/Ep/LqRdbJCZ1Rq03rqBdKT5Ky17Sz8zRLUksqIe9DW0pKtg/Z35/ztbLQ6qpOCN6rOC11A==}
engines: {node: ^16.0.0 || >=18.0.0}
@ -8352,10 +8277,6 @@ packages:
xtend: 4.0.2
dev: false
/es-html-parser@0.0.9:
resolution: {integrity: sha512-oniQMi+466VFsDzcdron9Ry/sqUJpDJg1bbDn0jFJKDdxXhwIOYDr4DgBnO5/yPLGj2xv+n5yy4L1Q0vAC5TYQ==}
dev: true
/es-module-lexer@1.2.1:
resolution: {integrity: sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==}
dev: false
@ -8683,8 +8604,8 @@ packages:
- supports-color
dev: true
/eslint-plugin-jsdoc@46.10.1(eslint@8.56.0):
resolution: {integrity: sha512-x8wxIpv00Y50NyweDUpa+58ffgSAI5sqe+zcZh33xphD0AVh+1kqr1ombaTRb7Fhpove1zfUuujlX9DWWBP5ag==}
/eslint-plugin-jsdoc@47.0.2(eslint@8.56.0):
resolution: {integrity: sha512-sIq81Pv+yrhhwY0m1JH79rdZRgDNunehv3S0Yv0UfewpoeJyPkODFn2o4o20nofVoI2tjku9/QBcCYUmmeWFXA==}
engines: {node: '>=16'}
peerDependencies:
eslint: ^7.0.0 || ^8.0.0 || ^9.0.0
@ -8773,7 +8694,7 @@ packages:
vue-eslint-parser:
optional: true
dependencies:
'@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3)
eslint: 8.56.0
minimatch: 9.0.3
natural-compare-lite: 1.4.0
@ -8854,7 +8775,7 @@ packages:
optional: true
dependencies:
'@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3)
eslint: 8.56.0
transitivePeerDependencies:
- supports-color
@ -14997,20 +14918,20 @@ packages:
/shell-quote@1.8.1:
resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==}
/shikiji-core@0.9.15:
resolution: {integrity: sha512-7hqIcUKS15OMs/61Qp2GvO1fSajBB36bDqi8vexIg5kp80V6v6SGtBrlq+nLlo7erMG2d1kvIuTIq1bwKI6fEg==}
/shikiji-core@0.9.16:
resolution: {integrity: sha512-eJIK8/IpzvAGnbckCE2Qf/fOSfpjVLSosUfI3pQAnbphGXagEqiRcT/gyVtL4llqmBh0nexqRdJKMFZF3A6ayw==}
dev: false
/shikiji-transformers@0.9.15:
resolution: {integrity: sha512-k0sQ6tX26/cdb8QV9CCwwr7QjRp6/AVP9C0oNIXNld3of+xCrpf74kD74piybG6vMfzBoHGsz/s60RVBJOUaYQ==}
/shikiji-transformers@0.9.16:
resolution: {integrity: sha512-DcvhYtLc3Xtme070vgyyeHX0XrNK0zHrKIiPk8wcptFbFUuS65qYDd/UFl68+R8KhdoSFTM9EXlBa9MhrGlbaw==}
dependencies:
shikiji: 0.9.15
shikiji: 0.9.16
dev: false
/shikiji@0.9.15:
resolution: {integrity: sha512-+inN4cN+nY7b0uCPOiqFHAk+cn2DEdM3AIQgPhAV7QKqhww/o7OGS5xvLh3SNnjke9C/HispALqGOQGYHVq7KQ==}
/shikiji@0.9.16:
resolution: {integrity: sha512-QeSwiW88gHke9deQ5Av1f6CEVPGW/riRMPT3vMDGPnASCOhBZK4TYk5ZRoa2qYLncPZS5kXKwcggccQvg3+U7Q==}
dependencies:
shikiji-core: 0.9.15
shikiji-core: 0.9.16
dev: false
/shimmer@1.2.1:

View File

@ -20,7 +20,7 @@ const isScrolling = ref(false)
const progress = computed(
() => (y.value / (bodyHeight.value - windowHeight.value)) * 100,
)
const percent = computed(() => `${Math.round(progress.value)}%`)
const percent = computed(() => `${Math.round(progress.value) || 0}%`)
const stroke = computed(() =>
`calc(${Math.PI * progress.value}% - ${4 * Math.PI}px) calc(${Math.PI * 100}% - ${4 * Math.PI}px)`,
@ -86,7 +86,9 @@ function handleClick() {
box-shadow: var(--vp-shadow-2);
background-color: var(--vp-c-bg);
inset-inline-end: 1rem;
transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
transition:
background-color 0.25s ease,
box-shadow 0.25s ease;
}
.back-to-top-button .percent,

View File

@ -146,13 +146,17 @@ const showBlogExtract = computed(() => {
background-color: var(--vp-c-bg);
border-top-left-radius: 12px;
border-top-right-radius: 12px;
box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.1), 0 -1px 4px rgba(0, 0, 0, 0.1);
box-shadow:
0 -3px 12px rgba(0, 0, 0, 0.1),
0 -1px 4px rgba(0, 0, 0, 0.1);
transform: translateY(100%);
transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.dark .blog-modal-container {
box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.3), 0 -1px 4px rgba(0, 0, 0, 0.27);
box-shadow:
0 -3px 12px rgba(0, 0, 0, 0.3),
0 -1px 4px rgba(0, 0, 0, 0.27);
}
.blog-modal-container.open {

View File

@ -44,7 +44,9 @@ const page = usePageData()
font-weight: 500;
color: var(--vp-c-text-1);
white-space: nowrap;
transition: background-color 0.25s, color 0.25s;
transition:
background-color 0.25s,
color 0.25s;
}
.link:hover {

View File

@ -66,11 +66,11 @@ export default {
<style scoped>
.flyout-wrapper {
position: relative;
transition: color 0.25s;
}
.flyout-wrapper:hover {
color: var(--vp-c-brand-1);
transition: color 0.25s;
}
.flyout-wrapper:hover .text {
@ -143,6 +143,9 @@ export default {
right: 0;
opacity: 0;
visibility: hidden;
transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
transition:
opacity 0.25s,
visibility 0.25s,
transform 0.25s;
}
</style>

View File

@ -82,7 +82,9 @@ const showLocalNav = computed(() => {
padding-top: var(--vp-layout-top-height, 0px);
width: 100%;
background-color: var(--vp-local-nav-bg-color);
transition: border-color 0.5s, background-color 0.5s;
transition:
border-color 0.5s,
background-color 0.5s;
}
.local-nav.fixed {

View File

@ -110,7 +110,7 @@ function scrollToTop() {
padding: 2px 0;
}
.open>.icon {
.open > .icon {
transform: rotate(90deg);
}
@ -148,11 +148,11 @@ function scrollToTop() {
}
.flyout-enter-active {
transition: all .2s ease-out;
transition: all 0.2s ease-out;
}
.flyout-leave-active {
transition: all .15s ease-in;
transition: all 0.15s ease-in;
}
.flyout-enter-from,

View File

@ -83,7 +83,10 @@ defineEmits<(e: 'click') => void>()
.navbar-hamburger.active:hover .middle,
.navbar-hamburger.active:hover .bottom {
background-color: var(--vp-c-text-2);
transition: top 0.25s, background-color 0.25s, transform 0.25s;
transition:
top 0.25s,
background-color 0.25s,
transform 0.25s;
}
.top,
@ -93,7 +96,10 @@ defineEmits<(e: 'click') => void>()
width: 16px;
height: 2px;
background-color: var(--vp-c-text-1);
transition: top 0.25s, background-color 0.5s, transform 0.25s;
transition:
top 0.25s,
background-color 0.5s,
transform 0.25s;
}
.top {

View File

@ -23,6 +23,12 @@
}
}
@media print {
.navbar-search {
display: none;
}
}
/* plugin-docsearch */
.DocSearch {
--docsearch-primary-color: var(--vp-c-brand-1);
@ -73,8 +79,8 @@
}
.navbar-search #docsearch-container {
min-width: 32px;
}
min-width: 32px;
}
@media (min-width: 768px) {
.navbar-search .DocSearch-Button {
@ -171,7 +177,9 @@
font-family: var(--vp-font-family-base);
font-size: 12px;
font-weight: 500;
transition: color 0.5s, border-color 0.5s;
transition:
color 0.5s,
border-color 0.5s;
}
.DocSearch-Button .DocSearch-Button-Key + .DocSearch-Button-Key {
@ -217,7 +225,7 @@
/* plugin-search */
.navbar-search .search-box input {
padding: 0 0.3rem 0 1.575rem;
padding: 0 0.4rem 0 1.555rem;
background-position: 0.5rem 0.4rem;
}
/* plugin-search */

View File

@ -114,7 +114,9 @@ function toggle() {
width: 14px;
height: 14px;
fill: var(--vp-c-text-2);
transition: fill 0.5s, transform 0.25s;
transition:
fill 0.5s,
transform 0.25s;
}
.group:first-child {

View File

@ -27,7 +27,9 @@ const closeScreen = inject('close-screen') as () => void
font-size: 14px;
font-weight: 500;
color: var(--vp-c-text-1);
transition: border-color 0.25s, color 0.25s;
transition:
border-color 0.25s,
color 0.25s;
}
.nav-screen-menu-link:hover {

View File

@ -96,7 +96,9 @@ function handlePrint() {
width: 2px;
height: 18px;
background-color: var(--vp-c-brand-1);
transition: top 0.25s cubic-bezier(0, 1, 0.5, 1), background-color 0.5s,
transition:
top 0.25s cubic-bezier(0, 1, 0.5, 1),
background-color 0.5s,
opacity 0.25s;
}

View File

@ -100,6 +100,12 @@ const showFooter = computed(() => {
color: var(--vp-c-brand-2);
}
@media print {
.edit-link-button {
display: none;
}
}
.edit-link-icon {
margin-right: 8px;
width: 14px;
@ -130,7 +136,7 @@ const showFooter = computed(() => {
text-align: left;
}
@media (min-width: 768px) {
@media (min-width: 640px) {
.contributors {
text-align: right;
}

View File

@ -140,7 +140,7 @@ const hasMeta = computed(() => readingTime.value.times || tags.value.length || c
}
.page-meta-wrapper .reading-time span {
margin-right: 0.5rem;
margin-right: 8px;
}
.page-meta-wrapper .reading-time span:last-of-type {

View File

@ -71,14 +71,18 @@ watch(
overflow-x: hidden;
overflow-y: auto;
transform: translateX(-100%);
transition: opacity 0.5s, transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
transition:
opacity 0.5s,
transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.sidebar-wrapper.open {
opacity: 1;
visibility: visible;
transform: translateX(0);
transition: opacity 0.25s, transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
transition:
opacity 0.25s,
transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.dark .sidebar-wrapper {

View File

@ -18,7 +18,9 @@
flex-shrink: 0;
border: 1px solid var(--vp-input-border-color);
background-color: var(--vp-input-switch-bg-color);
transition: border-color 0.25s ease, background-color 0.25s ease;
transition:
border-color 0.25s ease,
background-color 0.25s ease;
}
.switch-wrapper:hover {

View File

@ -56,11 +56,17 @@ function linkTo(e: Event) {
text-align: center;
font-weight: 600;
white-space: nowrap;
transition: color 0.25s, border-color 0.25s, background-color 0.25s;
transition:
color 0.25s,
border-color 0.25s,
background-color 0.25s;
}
.VPButton:active {
transition: color 0.1s, border-color 0.1s, background-color 0.1s;
transition:
color 0.1s,
border-color 0.1s,
background-color 0.1s;
}
.VPButton.medium {

View File

@ -44,7 +44,9 @@ const { hasSidebar } = useSidebar()
.plume-footer :deep(a) {
text-decoration-line: underline;
text-underline-offset: 2px;
transition: color, text-underline-offset 0.25s;
transition:
color,
text-underline-offset 0.25s;
}
.plume-footer :deep(a:hover) {

View File

@ -1,23 +1,11 @@
import { usePageLang, useSiteData } from '@vuepress/client'
import { useRouteLocale } from '@vuepress/client'
import { computed } from 'vue'
import { normalizeLink } from '../utils'
export function useLocaleLink(link: string) {
const site = useSiteData()
const locale = usePageLang()
const links = computed(() => {
const locales = site.value.locales
const links: Record<string, string> = {}
Object.keys(locales).forEach((key) => {
const locale = locales[key]
locale.lang && (links[locale.lang] = key)
})
return links
})
const prefix = useRouteLocale()
return computed(() => {
const prefix = links.value[locale.value] || '/'
return normalizeLink(prefix + link)
return normalizeLink(prefix.value + link)
})
}

View File

@ -15,15 +15,15 @@ export const readingTimeLocales = {
},
'zh-CN': {
word: '约 $word 字',
less1Minute: '小于 1 分钟',
time: '大约 $time 分钟',
word: '约$word字',
less1Minute: '小于1分钟',
time: '大约$time分钟',
},
'zh-TW': {
word: '約 $word 字',
less1Minute: '小於 1 分鐘',
time: '大约 $time 分鐘',
word: '約$word字',
less1Minute: '小於1分鐘',
time: '大约$time分鐘',
},
'de': {

View File

@ -94,7 +94,9 @@ const themeData = useThemeLocaleData()
font-size: 14px;
font-weight: 500;
color: var(--vp-c-brand);
transition: border-color 0.25s, color 0.25s;
transition:
border-color 0.25s,
color 0.25s;
}
.link:hover {

View File

@ -1 +0,0 @@
@import '@vuepress/plugin-palette/palette';

View File

@ -1,6 +1,3 @@
// ===============================
// Forked and modified from prismjs/themes/prism-tomorrow.css
.dark .vp-code span {
color: var(--shiki-dark, rgba(235, 235, 245, 0.6));
}
@ -11,13 +8,12 @@ html:not(.dark) .vp-code span {
.plume-content {
pre {
// line-height: 1.4;
padding: 1.3rem 1.5rem;
margin: 0 0 0.85rem 0;
border-radius: 6px;
overflow: auto;
scrollbar-width: thin;
scrollbar-color: var(--c-brand) var(--c-border);
scrollbar-color: var(--vp-c-brand-1) var(--vp-c-border);
font-size: 14px;
code {
@ -43,10 +39,6 @@ html:not(.dark) .vp-code span {
}
}
.code-tabs-nav {
margin-bottom: 0rem;
}
div[class*='language-'] {
position: relative;
background-color: var(--vp-code-block-bg);
@ -105,7 +97,6 @@ div[class*='language-'] {
left: 0;
top: 0;
display: block;
// width: var(--code-ln-wrapper-width);
height: 100%;
}
}
@ -125,7 +116,7 @@ div[class*='language-'] {
text-align: center;
z-index: 1;
color: var(--vp-code-line-number-color);
padding-top: 1.14rem;
padding-top: 1.25rem;
line-height: var(--vp-code-line-height);
counter-reset: line-number;
border-right: var(--vp-code-block-divider-color) 1px solid;
@ -153,14 +144,15 @@ div[class*='language-'] {
padding: 0 24px;
width: calc(100% + 2 * 24px);
display: inline-block;
}
z-index: 2;
.plume-content [class*='language-'] code .highlighted.error {
background-color: var(--vp-code-line-error-color);
}
&.error {
background-color: var(--vp-code-line-error-color);
}
.plume-content [class*='language-'] code .highlighted.warning {
background-color: var(--vp-code-line-warning-color);
&.warning {
background-color: var(--vp-code-line-warning-color);
}
}
.plume-content [class*='language-'] code .diff {
@ -169,22 +161,36 @@ div[class*='language-'] {
padding: 0 24px;
width: calc(100% + 2 * 24px);
display: inline-block;
}
.plume-content [class*='language-'] code .diff::before {
position: absolute;
left: 10px;
&::before {
position: absolute;
left: 10px;
}
&.remove {
background-color: var(--vp-code-line-diff-remove-color);
opacity: 0.7;
}
&.remove::before {
content: '-';
color: var(--vp-code-line-diff-remove-symbol-color);
transform: translateX(-6px);
}
&.add {
background-color: var(--vp-code-line-diff-add-color);
}
&.add::before {
content: '+';
color: var(--vp-code-line-diff-add-symbol-color);
transform: translateX(-6px);
}
}
.plume-content [class*='language-'] .has-focused-lines .line:not(.has-focus) {
filter: blur(0.095rem);
opacity: 0.4;
transition:
filter 0.35s,
opacity 0.35s;
}
.plume-content [class*='language-'] .has-focused-lines .line:not(.has-focus) {
opacity: 0.7;
transition:
filter 0.35s,
@ -199,25 +205,8 @@ div[class*='language-'] {
opacity: 1;
}
.plume-content [class*='language-'] code .diff.remove {
background-color: var(--vp-code-line-diff-remove-color);
opacity: 0.7;
}
.plume-content [class*='language-'] code .diff.remove::before {
content: '-';
color: var(--vp-code-line-diff-remove-symbol-color);
transform: translateX(-6px);
}
.plume-content [class*='language-'] code .diff.add {
background-color: var(--vp-code-line-diff-add-color);
}
.plume-content [class*='language-'] code .diff.add::before {
content: '+';
color: var(--vp-code-line-diff-add-symbol-color);
transform: translateX(-6px);
.code-tabs-nav {
margin-bottom: 0rem;
}
// narrow mobile
@ -237,7 +226,3 @@ div[class*='language-'] {
margin: 0 -1.5rem -0.85rem;
}
}
.hint-container.info pre code {
background-color: transparent;
}

View File

@ -213,44 +213,44 @@
* Custom Block
* -------------------------------------------------------------------------- */
.plume-content .custom-block {
margin: 16px 0;
}
// .plume-content .custom-block {
// margin: 16px 0;
// }
.plume-content .custom-block p {
margin: 8px 0;
line-height: 24px;
}
// .plume-content .custom-block p {
// margin: 8px 0;
// line-height: 24px;
// }
.plume-content .custom-block p:first-child {
margin: 0;
}
// .plume-content .custom-block p:first-child {
// margin: 0;
// }
.plume-content .custom-block a {
color: inherit;
font-weight: 600;
text-decoration: underline;
transition: opacity 0.25s;
}
// .plume-content .custom-block a {
// color: inherit;
// font-weight: 600;
// text-decoration: underline;
// transition: opacity 0.25s;
// }
.plume-content .custom-block a:hover {
opacity: 0.6;
}
// .plume-content .custom-block a:hover {
// opacity: 0.6;
// }
.plume-content .custom-block code {
font-size: var(--vp-custom-block-code-font-size);
font-weight: 700;
color: inherit;
}
// .plume-content .custom-block code {
// font-size: var(--vp-custom-block-code-font-size);
// font-weight: 700;
// color: inherit;
// }
.plume-content .custom-block div[class*='language-'] {
margin: 8px 0;
}
// .plume-content .custom-block div[class*='language-'] {
// margin: 8px 0;
// }
.plume-content .custom-block div[class*='language-'] code {
font-weight: 400;
background-color: transparent;
}
// .plume-content .custom-block div[class*='language-'] code {
// font-weight: 400;
// background-color: transparent;
// }
/**
* Code

View File

@ -1,11 +1,13 @@
@use 'vars';
@use 'fonts';
@use 'normalize';
@use 'nprogress';
@use 'utils';
@use 'content';
@use 'code';
@use 'md-enhance';
@use 'search';
@import '@vuepress/plugin-palette/palette';
@use '@vuepress/plugin-palette/style';
@import 'vars';
@import 'fonts';
@import 'normalize';
@import 'nprogress';
@import 'utils';
@import 'content';
@import 'code';
@import 'md-enhance';
@import 'search';
@import '@vuepress/plugin-palette/style';

View File

@ -11,6 +11,24 @@
margin-top: 0;
}
p + p {
margin: 8px 0;
}
code {
font-size: var(--vp-custom-block-code-font-size);
color: inherit;
}
div[class*='language-'] {
margin: 8px 0;
}
div[class*='language-'] code {
font-weight: 400;
background-color: transparent;
}
&.note {
border-radius: 0;
color: var(--vp-c-text-3);
@ -45,21 +63,12 @@
summary + p {
margin: 8px 0;
}
}
p + p {
margin: 8px 0;
}
code {
font-size: var(--vp-custom-block-code-font-size);
}
&.note,
&.info,
&.tip,
&.detail,
&.important {
&.detail {
a,
code {
color: var(--vp-c-brand-1);
@ -68,6 +77,15 @@
color: var(--vp-c-brand-2);
}
}
&.important {
a,
code {
color: var(--vp-c-purple-1);
}
a:hover {
color: var(--vp-c-purple-2);
}
}
&.warning {
a,
code {
@ -87,16 +105,10 @@
}
}
[class*="language-"] code {
background-color: transparent;
}
[class*="language-"] .line-numbers {
[class*='language-'] .line-numbers {
padding-top: 21px;
}
th,
blockquote > p {
font-size: var(--vp-custom-block-font-size);
@ -205,7 +217,6 @@
content: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="1em" height="1em" viewBox="0 0 32 32"%3E%3Cpath fill="%23299764" d="M29.548 3.043a2.5 2.5 0 0 0-3.513.4L16 16.067l-3.508-4.414a2.5 2.5 0 0 0-3.915 3.112l5.465 6.875c.474.597 1.195.943 1.957.943s1.482-.35 1.957-.944L29.95 6.555c.86-1.08.68-2.654-.402-3.513zM24.5 24.5h-17v-17h12.756l2.385-3H6c-.83 0-1.5.67-1.5 1.5v20c0 .828.67 1.5 1.5 1.5h20a1.5 1.5 0 0 0 1.5-1.5V12.85l-3 3.774z"%2F%3E%3C%2Fsvg%3E');
border: none;
background-color: transparent;
}
}
}

View File

@ -52,7 +52,8 @@ html,
body {
color: var(--vp-c-text-1);
background-color: var(--vp-c-bg);
transition: var(--t-color);
transition-duration: 0.25s;
transition-timing-function: ease;
transition-property: color, background-color;
}

View File

@ -1,14 +1,14 @@
#nprogress .bar {
background: var(--vp-c-brand);
background: var(--vp-c-brand-1);
}
#nprogress .spinner-icon {
border-top-color: var(--vp-c-brand);
border-left-color: var(--vp-c-brand);
border-top-color: var(--vp-c-brand-1);
border-left-color: var(--vp-c-brand-1);
}
#nprogress .peg {
box-shadow:
0 0 10px var(--vp-c-brand),
0 0 5px var(--vp-c-brand);
0 0 10px var(--vp-c-brand-1),
0 0 5px var(--vp-c-brand-1);
}

View File

@ -69,7 +69,10 @@
--vp-c-red-3: #e0575b;
--vp-c-red-soft: rgba(244, 63, 94, 0.14);
--vp-c-purple: #f4eefe;
--vp-c-purple-1: #734bb0;
--vp-c-purple-2: #9a72da;
--vp-c-purple-3: #d2c5e7;
--vp-c-purple-soft: rgba(109, 85, 148, 0.14);
--vp-c-sponsor: #db2777;
}
@ -95,7 +98,10 @@
--vp-c-yellow-3: #a46a0a;
--vp-c-yellow-soft: rgba(234, 179, 8, 0.16);
--vp-c-purple: #423655;
--vp-c-purple-1: #9c74da;
--vp-c-purple-2: #a987df;
--vp-c-purple-3: #c3b4da;
--vp-c-purple-soft: rgba(109, 85, 148, 0.16);
--vp-c-red-1: #f66f81;
--vp-c-red-2: #f14158;
@ -372,15 +378,15 @@ html[lang='zh-CN'] {
--vp-button-alt-active-text: var(--vp-c-text-1);
--vp-button-alt-active-bg: var(--vp-c-default-1);
--vp-button-sponsor-border: var(--vp-c-text-2);
--vp-button-sponsor-text: var(--vp-c-text-2);
--vp-button-sponsor-bg: transparent;
--vp-button-sponsor-hover-border: var(--vp-c-sponsor);
--vp-button-sponsor-hover-text: var(--vp-c-sponsor);
--vp-button-sponsor-hover-bg: transparent;
--vp-button-sponsor-active-border: var(--vp-c-sponsor);
--vp-button-sponsor-active-text: var(--vp-c-sponsor);
--vp-button-sponsor-active-bg: transparent;
// --vp-button-sponsor-border: var(--vp-c-text-2);
// --vp-button-sponsor-text: var(--vp-c-text-2);
// --vp-button-sponsor-bg: transparent;
// --vp-button-sponsor-hover-border: var(--vp-c-sponsor);
// --vp-button-sponsor-hover-text: var(--vp-c-sponsor);
// --vp-button-sponsor-hover-bg: transparent;
// --vp-button-sponsor-active-border: var(--vp-c-sponsor);
// --vp-button-sponsor-active-text: var(--vp-c-sponsor);
// --vp-button-sponsor-active-bg: transparent;
}
.dark {
@ -449,7 +455,7 @@ html[lang='zh-CN'] {
--vp-nav-height: 0px;
}
.hide-nav .VPSidebar {
.hide-nav .sidebar {
--vp-nav-height: 22px;
}
@ -541,15 +547,15 @@ html[lang='zh-CN'] {
* Component: Local Search
* -------------------------------------------------------------------------- */
:root {
--vp-local-search-bg: var(--vp-c-bg);
--vp-local-search-result-bg: var(--vp-c-bg);
--vp-local-search-result-border: var(--vp-c-divider);
--vp-local-search-result-selected-bg: var(--vp-c-bg);
--vp-local-search-result-selected-border: var(--vp-c-brand-1);
--vp-local-search-highlight-bg: var(--vp-c-brand-1);
--vp-local-search-highlight-text: var(--vp-c-neutral-inverse);
}
// :root {
// --vp-local-search-bg: var(--vp-c-bg);
// --vp-local-search-result-bg: var(--vp-c-bg);
// --vp-local-search-result-border: var(--vp-c-divider);
// --vp-local-search-result-selected-bg: var(--vp-c-bg);
// --vp-local-search-result-selected-border: var(--vp-c-brand-1);
// --vp-local-search-highlight-bg: var(--vp-c-brand-1);
// --vp-local-search-highlight-text: var(--vp-c-neutral-inverse);
// }
/** Component: Search **/
:root {
@ -580,9 +586,9 @@ html[lang='zh-CN'] {
html.dark {
/* important */
--important-title-color: var(--vp-c-text-1);
--important-bg-color: var(--vp-c-purple);
--important-border-color: var(--vp-c-purple);
--important-code-bg-color: rgb(163 113 247 / 10%);
--important-bg-color: var(--vp-c-purple-soft);
--important-border-color: transparent;
--important-code-bg-color: var(--vp-c-purple-soft);
// info
--info-title-color: var(--vp-c-text-1);

View File

@ -1,18 +1,20 @@
<!DOCTYPE html>
<!doctype html>
<html lang="{{ lang }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress {{ version }}">
<meta name="theme" content="VuePress Theme Plume {{ themeVersion }}">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="generator" content="VuePress {{ version }}" />
<meta name="theme" content="VuePress Theme Plume {{ themeVersion }}" />
<script>
(function() {
const um = localStorage.getItem('vuepress-theme-appearance');
const sm = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
;(function () {
const um = localStorage.getItem('vuepress-theme-appearance')
const sm =
window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches
if (um === 'dark' || (um !== 'light' && sm)) {
document.documentElement.classList.add('dark');
document.documentElement.classList.add('dark')
}
})();
})()
</script>
<!--vuepress-ssr-head-->
<!--vuepress-ssr-styles-->