mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
Compare commits
86 Commits
v1.0.0-rc.
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d69e0b9765 | ||
|
|
02038f2df0 | ||
|
|
e5126663ef | ||
|
|
402f259086 | ||
|
|
58ea2fc8cb | ||
|
|
6ebb1bda6e | ||
|
|
68f39695c4 | ||
|
|
76787f6530 | ||
|
|
e2b47da532 | ||
|
|
035d521e96 | ||
|
|
bfd0c8409c | ||
|
|
e11c7a8fcd | ||
|
|
1329051536 | ||
|
|
0677f6749e | ||
|
|
28963eb419 | ||
|
|
cfc89adab8 | ||
|
|
e0ba59a6f9 | ||
|
|
352874b29a | ||
|
|
c824ad85f4 | ||
|
|
db2eda82f3 | ||
|
|
e9fe35bc4f | ||
|
|
709ade741c | ||
|
|
d8b79e89e8 | ||
|
|
dbc6f0be0f | ||
|
|
9fe294b9dd | ||
|
|
ecf100cfc6 | ||
|
|
b7ee45642e | ||
|
|
54c05c8cea | ||
|
|
86cb872ce6 | ||
|
|
a6cb3820b1 | ||
|
|
184d1aee76 | ||
|
|
cbc5c55891 | ||
|
|
4f40f8441d | ||
|
|
fe0d4bbc92 | ||
|
|
39a76a35d7 | ||
|
|
a01bc13c66 | ||
|
|
1b213d4c28 | ||
|
|
aede6f5d87 | ||
|
|
7febfbf237 | ||
|
|
7ce4e40521 | ||
|
|
12c4f5b39e | ||
|
|
aa54090b5d | ||
|
|
192b260d2b | ||
|
|
75df783295 | ||
|
|
97a5ba20c3 | ||
|
|
896c7e22df | ||
|
|
77856e36c5 | ||
|
|
552f0f5c32 | ||
|
|
7751e4c798 | ||
|
|
17646708b1 | ||
|
|
f14d663bb5 | ||
|
|
50fa747ec1 | ||
|
|
f6da09df54 | ||
|
|
9b9f8f3f77 | ||
|
|
aa19049f5b | ||
|
|
fd1dd7c695 | ||
|
|
916e9141d9 | ||
|
|
ca51a345fb | ||
|
|
f11e8501d0 | ||
|
|
3f047914d5 | ||
|
|
0a3810be2b | ||
|
|
c541e05997 | ||
|
|
feb69a282e | ||
|
|
c109d54961 | ||
|
|
948c31779b | ||
|
|
09a95b7597 | ||
|
|
ce32605aee | ||
|
|
f7d3546962 | ||
|
|
5980fd81f3 | ||
|
|
f2fe79f923 | ||
|
|
7234eebe7e | ||
|
|
479680bba6 | ||
|
|
cd68f1cdd9 | ||
|
|
97c7a53aed | ||
|
|
03dc9da8dc | ||
|
|
a4c9c85b00 | ||
|
|
1ed3dd9154 | ||
|
|
bfd1d1692f | ||
|
|
6db6a58c27 | ||
|
|
9751059fcd | ||
|
|
fc9984b27c | ||
|
|
5930c60462 | ||
|
|
f173d069bd | ||
|
|
5c201e3ed0 | ||
|
|
77da8a3470 | ||
|
|
9c3899135b |
3
.github/workflows/docs-deploy.yaml
vendored
3
.github/workflows/docs-deploy.yaml
vendored
@ -13,6 +13,9 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-docs:
|
deploy-docs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@ -6,6 +6,9 @@ on:
|
|||||||
- v*
|
- v*
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-docs:
|
deploy-docs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
3
.github/workflows/lint.yaml
vendored
3
.github/workflows/lint.yaml
vendored
@ -8,6 +8,9 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
7
.github/workflows/release.yaml
vendored
7
.github/workflows/release.yaml
vendored
@ -5,6 +5,10 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
uses: ./.github/workflows/lint.yaml
|
uses: ./.github/workflows/lint.yaml
|
||||||
@ -16,9 +20,6 @@ jobs:
|
|||||||
if: github.repository == 'pengzhanbo/vuepress-theme-plume'
|
if: github.repository == 'pengzhanbo/vuepress-theme-plume'
|
||||||
needs: [test, lint]
|
needs: [test, lint]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
id-token: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
|
|||||||
3
.github/workflows/test.yaml
vendored
3
.github/workflows/test.yaml
vendored
@ -8,6 +8,9 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unit-test:
|
unit-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -15,3 +15,6 @@ dist/
|
|||||||
|
|
||||||
coverage/
|
coverage/
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
.claude/
|
||||||
|
!.claude/skills/
|
||||||
|
|||||||
519
CHANGELOG.md
519
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
111
CLAUDE.md
Normal file
111
CLAUDE.md
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
vuepress-theme-plume is a VuePress 2 theme monorepo for building blogs, documentation, and knowledge bases.
|
||||||
|
It includes a main theme, several plugins, a CLI tool, and example implementations.
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install dependencies
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
# Build all packages (required after clone, outputs to lib/)
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
# Development - runs theme + docs dev servers concurrently
|
||||||
|
pnpm dev
|
||||||
|
|
||||||
|
# Lint (eslint + stylelint)
|
||||||
|
pnpm lint
|
||||||
|
pnpm lint:fix # auto-fix
|
||||||
|
|
||||||
|
# Run tests (vitest)
|
||||||
|
pnpm test
|
||||||
|
|
||||||
|
# Run a single test file
|
||||||
|
pnpm test src/path/to/file.spec.ts
|
||||||
|
|
||||||
|
# Run tests related to changed files (for pre-commit)
|
||||||
|
cross-env TZ=Etc/UTC vitest related --run
|
||||||
|
|
||||||
|
# Build docs only
|
||||||
|
pnpm docs:build
|
||||||
|
|
||||||
|
# Serve docs locally
|
||||||
|
pnpm docs:serve
|
||||||
|
|
||||||
|
# Release workflow
|
||||||
|
pnpm release # runs lint + build + version bump + changelog + git commit
|
||||||
|
```
|
||||||
|
|
||||||
|
## Monorepo Structure
|
||||||
|
|
||||||
|
```txt
|
||||||
|
├── theme/ # Main VuePress theme (vuepress-theme-plume)
|
||||||
|
├── plugins/ # VuePress plugins
|
||||||
|
│ ├── plugin-search/ # Full-text fuzzy search
|
||||||
|
│ ├── plugin-md-power/ # Markdown enhancements
|
||||||
|
│ └── plugin-fonts/ # Special character font support
|
||||||
|
├── cli/ # CLI tool (create project scaffolding)
|
||||||
|
├── docs/ # Documentation site
|
||||||
|
└── examples/ # Example implementations
|
||||||
|
├── pure-blog/
|
||||||
|
└── layout-slots/
|
||||||
|
```
|
||||||
|
|
||||||
|
## Theme Architecture
|
||||||
|
|
||||||
|
The theme is organized into three layers:
|
||||||
|
|
||||||
|
- **`src/node/`** - Build-time code (runs during `vuepress build/dev`)
|
||||||
|
- `prepare/` - Content preparation (frontmatter parsing, collection resolution)
|
||||||
|
- `plugins/` - VuePress plugin registration
|
||||||
|
- `config/` - Theme configuration handling
|
||||||
|
- `autoFrontmatter/` - Automatic frontmatter generation
|
||||||
|
|
||||||
|
- **`src/client/`** - Client-side code (runs in browser)
|
||||||
|
- `components/` - Vue components
|
||||||
|
- `composables/` - Vue composables (outline, search, etc.)
|
||||||
|
- `styles/` - CSS/SCSS styles
|
||||||
|
- `features/` - Feature-specific components and logic
|
||||||
|
|
||||||
|
- **`src/shared/`** - Shared code (used by both node and client)
|
||||||
|
- `frontmatter/` - Frontmatter schemas and utilities
|
||||||
|
- `locale/` - i18n translations
|
||||||
|
- `options.ts` - Theme options types
|
||||||
|
- `features/` - Feature flags and shared feature logic
|
||||||
|
|
||||||
|
## Build Output
|
||||||
|
|
||||||
|
Each package uses [tsdown](https://tsdown.dev/) to compile TypeScript. Build output goes to `lib/`:
|
||||||
|
|
||||||
|
- `lib/node/` - Node-side exports
|
||||||
|
- `lib/client/` - Client-side exports
|
||||||
|
- `lib/shared/` - Shared exports
|
||||||
|
|
||||||
|
The `lib/` directory is gitignored and must be built with `pnpm build`.
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
Tests use Vitest with coverage enabled. Test files are located at `**/__test__/**/*.spec.ts` and are excluded from coverage reports. Run tests with timezone fixed to UTC to ensure consistent results.
|
||||||
|
|
||||||
|
## Key Dependencies
|
||||||
|
|
||||||
|
- **VuePress**: v2.0.0-rc.28 with @vuepress/bundler-vite
|
||||||
|
- **Vue**: ^3.5.30
|
||||||
|
- **Shiki**: ^4.x for syntax highlighting
|
||||||
|
- **VueUse**: ^14.x for composables
|
||||||
|
- **markdown-it**: ^14.x for Markdown processing
|
||||||
|
|
||||||
|
## Development Notes
|
||||||
|
|
||||||
|
- Node.js 20.19.0+ required
|
||||||
|
- pnpm catalogs are used for dependency management (`dev`, `peer`, `prod`, `vuepress`)
|
||||||
|
- The theme depends on `vuepress-plugin-md-power` and `@vuepress-plume/plugin-search` as workspace dependencies
|
||||||
|
- Some peer dependencies are optional (e.g., artplayer, dashjs, three.js)
|
||||||
|
- Plugins (`plugins/*`) do not have dev commands — changes require `pnpm build` to take effect
|
||||||
|
- The `lib/` directory is gitignored and must be rebuilt after `pnpm install`
|
||||||
@ -19,7 +19,7 @@ In the `plugins` directory:
|
|||||||
|
|
||||||
Development requirements:
|
Development requirements:
|
||||||
|
|
||||||
- [Node.js](http://nodejs.org/) version 20.6.0+
|
- [Node.js](http://nodejs.org/) version 20.19.0+
|
||||||
- [pnpm](https://pnpm.io/zh/) version 9+
|
- [pnpm](https://pnpm.io/zh/) version 9+
|
||||||
|
|
||||||
Clone the repository and install dependencies:
|
Clone the repository and install dependencies:
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
开发要求:
|
开发要求:
|
||||||
|
|
||||||
- [Node.js](http://nodejs.org/) version 20.6.0+
|
- [Node.js](http://nodejs.org/) version 20.19.0+
|
||||||
- [pnpm](https://pnpm.io/zh/) version 9+
|
- [pnpm](https://pnpm.io/zh/) version 9+
|
||||||
|
|
||||||
克隆代码仓库,并安装依赖:
|
克隆代码仓库,并安装依赖:
|
||||||
|
|||||||
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ---------------- | ------------------ |
|
| ---------------- | ------------------ |
|
||||||
| >= 1.0.0-rc.170 | :white_check_mark: |
|
| >= 1.0.0-rc.190 | :white_check_mark: |
|
||||||
| < 1.0.0-rc.170 | :x: |
|
| < 1.0.0-rc.190 | :x: |
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "create-vuepress-theme-plume",
|
"name": "create-vuepress-theme-plume",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.0.0-rc.188",
|
"version": "1.0.0-rc.196",
|
||||||
"description": "The cli for create vuepress-theme-plume's project",
|
"description": "The cli for create vuepress-theme-plume's project",
|
||||||
"author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
|
"author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -27,7 +27,7 @@
|
|||||||
"templates"
|
"templates"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsdown"
|
"build": "tsdown --config-loader unrun"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clack/prompts": "catalog:prod",
|
"@clack/prompts": "catalog:prod",
|
||||||
@ -40,8 +40,8 @@
|
|||||||
"sort-package-json": "catalog:prod"
|
"sort-package-json": "catalog:prod"
|
||||||
},
|
},
|
||||||
"plume-deps": {
|
"plume-deps": {
|
||||||
"vuepress": "2.0.0-rc.26",
|
"vuepress": "2.0.0-rc.28",
|
||||||
"vue": "^3.5.26",
|
"vue": "^3.5.32",
|
||||||
"http-server": "^14.1.1",
|
"http-server": "^14.1.1",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,27 +1,86 @@
|
|||||||
import type { Bundler, Langs, Options } from './types.js'
|
import type { Bundler, Langs, Options } from './types.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Language options for VuePress configuration
|
||||||
|
*
|
||||||
|
* 语言选项,用于 VuePress 配置
|
||||||
|
*/
|
||||||
export const languageOptions: Options<Langs> = [
|
export const languageOptions: Options<Langs> = [
|
||||||
{ label: 'English', value: 'en-US' },
|
{ label: 'English', value: 'en-US' },
|
||||||
{ label: '简体中文', value: 'zh-CN' },
|
{ label: '简体中文', value: 'zh-CN' },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bundler options for VuePress build tool
|
||||||
|
*
|
||||||
|
* 构建器选项,用于 VuePress 构建工具
|
||||||
|
*/
|
||||||
export const bundlerOptions: Options<Bundler> = [
|
export const bundlerOptions: Options<Bundler> = [
|
||||||
{ label: 'Vite', value: 'vite' },
|
{ label: 'Vite', value: 'vite' },
|
||||||
{ label: 'Webpack', value: 'webpack' },
|
{ label: 'Webpack', value: 'webpack' },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operation mode for VuePress CLI
|
||||||
|
*
|
||||||
|
* VuePress CLI 操作模式
|
||||||
|
* @readonly
|
||||||
|
* @enum {number}
|
||||||
|
*/
|
||||||
export enum Mode {
|
export enum Mode {
|
||||||
|
/**
|
||||||
|
* Initialize existing directory
|
||||||
|
*
|
||||||
|
* 初始化现有目录
|
||||||
|
*/
|
||||||
init,
|
init,
|
||||||
|
/**
|
||||||
|
* Create new project
|
||||||
|
*
|
||||||
|
* 创建新项目
|
||||||
|
*/
|
||||||
create,
|
create,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deployment type for VuePress site
|
||||||
|
*
|
||||||
|
* VuePress 站点部署类型
|
||||||
|
* @readonly
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
export enum DeployType {
|
export enum DeployType {
|
||||||
|
/**
|
||||||
|
* GitHub Pages deployment
|
||||||
|
*
|
||||||
|
* GitHub Pages 部署
|
||||||
|
*/
|
||||||
github = 'github',
|
github = 'github',
|
||||||
|
/**
|
||||||
|
* Vercel deployment
|
||||||
|
*
|
||||||
|
* Vercel 部署
|
||||||
|
*/
|
||||||
vercel = 'vercel',
|
vercel = 'vercel',
|
||||||
|
/**
|
||||||
|
* Netlify deployment
|
||||||
|
*
|
||||||
|
* Netlify 部署
|
||||||
|
*/
|
||||||
netlify = 'netlify',
|
netlify = 'netlify',
|
||||||
|
/**
|
||||||
|
* Custom deployment
|
||||||
|
*
|
||||||
|
* 自定义部署
|
||||||
|
*/
|
||||||
custom = 'custom',
|
custom = 'custom',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deployment options for hosting platforms
|
||||||
|
*
|
||||||
|
* 部署选项,用于托管平台
|
||||||
|
*/
|
||||||
export const deployOptions: Options<DeployType> = [
|
export const deployOptions: Options<DeployType> = [
|
||||||
{ label: 'Custom', value: DeployType.custom },
|
{ label: 'Custom', value: DeployType.custom },
|
||||||
{ label: 'GitHub Pages', value: DeployType.github },
|
{ label: 'GitHub Pages', value: DeployType.github },
|
||||||
|
|||||||
@ -8,6 +8,15 @@ import { createPackageJson } from './packageJson.js'
|
|||||||
import { createRender } from './render.js'
|
import { createRender } from './render.js'
|
||||||
import { getTemplate, readFiles, readJsonFile, writeFiles } from './utils/index.js'
|
import { getTemplate, readFiles, readJsonFile, writeFiles } from './utils/index.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate VuePress project files
|
||||||
|
*
|
||||||
|
* 生成 VuePress 项目文件
|
||||||
|
*
|
||||||
|
* @param mode - Operation mode (init or create) / 操作模式(初始化或创建)
|
||||||
|
* @param data - Resolved configuration data / 解析后的配置数据
|
||||||
|
* @param cwd - Current working directory / 当前工作目录
|
||||||
|
*/
|
||||||
export async function generate(
|
export async function generate(
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
data: ResolvedData,
|
data: ResolvedData,
|
||||||
@ -106,6 +115,14 @@ export async function generate(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create documentation files based on configuration
|
||||||
|
*
|
||||||
|
* 根据配置创建文档文件
|
||||||
|
*
|
||||||
|
* @param data - Resolved configuration data / 解析后的配置数据
|
||||||
|
* @returns Array of file objects / 文件对象数组
|
||||||
|
*/
|
||||||
async function createDocsFiles(data: ResolvedData): Promise<File[]> {
|
async function createDocsFiles(data: ResolvedData): Promise<File[]> {
|
||||||
const fileList: File[] = []
|
const fileList: File[] = []
|
||||||
if (data.multiLanguage) {
|
if (data.multiLanguage) {
|
||||||
@ -131,6 +148,15 @@ async function createDocsFiles(data: ResolvedData): Promise<File[]> {
|
|||||||
return updateFileListTarget(fileList, data.docsDir)
|
return updateFileListTarget(fileList, data.docsDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update file list target path
|
||||||
|
*
|
||||||
|
* 更新文件列表的目标路径
|
||||||
|
*
|
||||||
|
* @param fileList - Array of files / 文件数组
|
||||||
|
* @param target - Target directory path / 目标目录路径
|
||||||
|
* @returns Updated file array / 更新后的文件数组
|
||||||
|
*/
|
||||||
function updateFileListTarget(fileList: File[], target: string): File[] {
|
function updateFileListTarget(fileList: File[], target: string): File[] {
|
||||||
return fileList.map(({ filepath, content }) => ({
|
return fileList.map(({ filepath, content }) => ({
|
||||||
filepath: path.join(target, filepath),
|
filepath: path.join(target, filepath),
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* VuePress Theme Plume CLI Entry Point
|
||||||
|
*
|
||||||
|
* VuePress Theme Plume CLI 入口文件
|
||||||
|
*
|
||||||
|
* This module provides command-line interface for creating and initializing
|
||||||
|
* VuePress projects with vuepress-theme-plume.
|
||||||
|
*
|
||||||
|
* 本模块提供用于创建和初始化 VuePress 项目的命令行接口。
|
||||||
|
*
|
||||||
|
* @module cli
|
||||||
|
*/
|
||||||
import cac from 'cac'
|
import cac from 'cac'
|
||||||
import { version } from '../package.json'
|
import { version } from '../package.json'
|
||||||
import { Mode } from './constants.js'
|
import { Mode } from './constants.js'
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
import type { Locale } from '../types.js'
|
import type { Locale } from '../types.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* English locale configuration for CLI prompts and messages.
|
||||||
|
*
|
||||||
|
* CLI 提示和消息的英语本地化配置。
|
||||||
|
*/
|
||||||
export const en: Locale = {
|
export const en: Locale = {
|
||||||
'question.root': 'Where would you want to initialize VuePress?',
|
'question.root': 'Where would you want to initialize VuePress?',
|
||||||
'question.site.name': 'Site Name:',
|
'question.site.name': 'Site Name:',
|
||||||
|
|||||||
@ -2,6 +2,15 @@ import type { Langs, Locale } from '../types.js'
|
|||||||
import { en } from './en.js'
|
import { en } from './en.js'
|
||||||
import { zh } from './zh.js'
|
import { zh } from './zh.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Locale configurations for different languages.
|
||||||
|
*
|
||||||
|
* 不同语言的本地化配置。
|
||||||
|
*
|
||||||
|
* Maps language codes to their respective locale strings.
|
||||||
|
*
|
||||||
|
* 将语言代码映射到相应的本地化字符串。
|
||||||
|
*/
|
||||||
export const locales: Record<Langs, Locale> = {
|
export const locales: Record<Langs, Locale> = {
|
||||||
'zh-CN': zh,
|
'zh-CN': zh,
|
||||||
'en-US': en,
|
'en-US': en,
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
import type { Locale } from '../types.js'
|
import type { Locale } from '../types.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chinese (Simplified) locale configuration for CLI prompts and messages.
|
||||||
|
*
|
||||||
|
* CLI 提示和消息的简体中文本地化配置。
|
||||||
|
*/
|
||||||
export const zh: Locale = {
|
export const zh: Locale = {
|
||||||
'question.root': '您想在哪里初始化 VuePress?',
|
'question.root': '您想在哪里初始化 VuePress?',
|
||||||
'question.site.name': '站点名称:',
|
'question.site.name': '站点名称:',
|
||||||
|
|||||||
@ -1,16 +1,41 @@
|
|||||||
import type { File, ResolvedData } from './types.js'
|
import type { File, ResolvedData } from './types.js'
|
||||||
import { kebabCase } from '@pengzhanbo/utils'
|
import { attemptAsync, kebabCase } from '@pengzhanbo/utils'
|
||||||
import spawn from 'nano-spawn'
|
import spawn from 'nano-spawn'
|
||||||
import _sortPackageJson from 'sort-package-json'
|
import _sortPackageJson from 'sort-package-json'
|
||||||
import { Mode } from './constants.js'
|
import { Mode } from './constants.js'
|
||||||
import { readJsonFile, resolve } from './utils/index.js'
|
import { readJsonFile, resolve } from './utils/index.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort package.json fields in a consistent order.
|
||||||
|
*
|
||||||
|
* 按一致顺序排序 package.json 字段。
|
||||||
|
*
|
||||||
|
* @param json - Package.json object to sort / 要排序的 package.json 对象
|
||||||
|
* @returns Sorted package.json object / 排序后的 package.json 对象
|
||||||
|
*/
|
||||||
function sortPackageJson(json: Record<any, any>) {
|
function sortPackageJson(json: Record<any, any>) {
|
||||||
return _sortPackageJson(json, {
|
return _sortPackageJson(json, {
|
||||||
sortOrder: ['name', 'type', 'version', 'private', 'description', 'packageManager', 'author', 'license', 'scripts', 'devDependencies', 'dependencies', 'pnpm'],
|
sortOrder: ['name', 'type', 'version', 'private', 'description', 'packageManager', 'author', 'license', 'scripts', 'devDependencies', 'dependencies', 'pnpm'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create package.json file for VuePress project
|
||||||
|
*
|
||||||
|
* 为 VuePress 项目创建 package.json 文件
|
||||||
|
*
|
||||||
|
* @param mode - Operation mode (init or create) / 操作模式(初始化或创建)
|
||||||
|
* @param pkg - Existing package.json data / 现有的 package.json 数据
|
||||||
|
* @param data - Resolved configuration data / 解析后的配置数据
|
||||||
|
* @param data.packageManager - Package manager to use / 要使用的包管理器
|
||||||
|
* @param data.siteName - Site name / 站点名称
|
||||||
|
* @param data.siteDescription - Site description / 站点描述
|
||||||
|
* @param data.docsDir - Documentation directory path / 文档目录路径
|
||||||
|
* @param data.bundler - Bundler to use / 要使用的打包器
|
||||||
|
* @param data.injectNpmScripts - Whether to inject npm scripts / 是否注入 npm 脚本
|
||||||
|
*
|
||||||
|
* @returns File object with package.json content / 包含 package.json 内容的文件对象
|
||||||
|
*/
|
||||||
export async function createPackageJson(
|
export async function createPackageJson(
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
pkg: Record<string, any>,
|
pkg: Record<string, any>,
|
||||||
@ -30,7 +55,7 @@ export async function createPackageJson(
|
|||||||
pkg.description = siteDescription
|
pkg.description = siteDescription
|
||||||
|
|
||||||
if (packageManager !== 'npm') {
|
if (packageManager !== 'npm') {
|
||||||
let version = await getPackageManagerVersion(packageManager)
|
let [, version] = await attemptAsync(getPackageManagerVersion, packageManager)
|
||||||
if (version) {
|
if (version) {
|
||||||
if (packageManager === 'yarn' && version.startsWith('1')) {
|
if (packageManager === 'yarn' && version.startsWith('1')) {
|
||||||
version = '4.10.3'
|
version = '4.10.3'
|
||||||
@ -46,7 +71,7 @@ export async function createPackageJson(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const userInfo = await getUserInfo()
|
const [, userInfo] = await attemptAsync(getUserInfo)
|
||||||
if (userInfo) {
|
if (userInfo) {
|
||||||
pkg.author = userInfo.username + (userInfo.email ? ` <${userInfo.email}>` : '')
|
pkg.author = userInfo.username + (userInfo.email ? ` <${userInfo.email}>` : '')
|
||||||
}
|
}
|
||||||
@ -94,24 +119,30 @@ export async function createPackageJson(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user information from git global configuration.
|
||||||
|
*
|
||||||
|
* 从 git 全局配置获取用户信息。
|
||||||
|
*
|
||||||
|
* @returns User information object with username and email / 包含用户名和邮箱的用户信息对象
|
||||||
|
* @throws Error if git command fails / 如果 git 命令失败则抛出错误
|
||||||
|
*/
|
||||||
async function getUserInfo() {
|
async function getUserInfo() {
|
||||||
try {
|
const { output: username } = await spawn('git', ['config', '--global', 'user.name'])
|
||||||
const { output: username } = await spawn('git', ['config', '--global', 'user.name'])
|
const { output: email } = await spawn('git', ['config', '--global', 'user.email'])
|
||||||
const { output: email } = await spawn('git', ['config', '--global', 'user.email'])
|
return { username, email }
|
||||||
console.log('userInfo', username, email)
|
|
||||||
return { username, email }
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the version of a package manager.
|
||||||
|
*
|
||||||
|
* 获取包管理器的版本。
|
||||||
|
*
|
||||||
|
* @param pkg - Package manager name (npm, yarn, pnpm) / 包管理器名称
|
||||||
|
* @returns Version string of the package manager / 包管理器的版本字符串
|
||||||
|
* @throws Error if package manager command fails / 如果包管理器命令失败则抛出错误
|
||||||
|
*/
|
||||||
async function getPackageManagerVersion(pkg: string) {
|
async function getPackageManagerVersion(pkg: string) {
|
||||||
try {
|
const { output } = await spawn(pkg, ['--version'])
|
||||||
const { output } = await spawn(pkg, ['--version'])
|
return output
|
||||||
return output
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import type { Bundler, Langs, PromptResult } from './types.js'
|
|||||||
import { createRequire } from 'node:module'
|
import { createRequire } from 'node:module'
|
||||||
import process from 'node:process'
|
import process from 'node:process'
|
||||||
import { cancel, confirm, group, select, text } from '@clack/prompts'
|
import { cancel, confirm, group, select, text } from '@clack/prompts'
|
||||||
import { osLocale } from 'os-locale'
|
import osLocale from 'os-locale'
|
||||||
import { bundlerOptions, deployOptions, DeployType, languageOptions, Mode } from './constants.js'
|
import { bundlerOptions, deployOptions, DeployType, languageOptions, Mode } from './constants.js'
|
||||||
import { setLang, t } from './translate.js'
|
import { setLang, t } from './translate.js'
|
||||||
|
|
||||||
@ -10,6 +10,15 @@ const require = createRequire(process.cwd())
|
|||||||
|
|
||||||
const REG_DIR_CHAR = /[<>:"\\|?*[\]]/
|
const REG_DIR_CHAR = /[<>:"\\|?*[\]]/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prompt user for project configuration
|
||||||
|
*
|
||||||
|
* 提示用户输入项目配置
|
||||||
|
*
|
||||||
|
* @param mode - Operation mode (init or create) / 操作模式(初始化或创建)
|
||||||
|
* @param root - Optional root directory path / 可选的根目录路径
|
||||||
|
* @returns Resolved prompt result / 解析后的提示结果
|
||||||
|
*/
|
||||||
export async function prompt(mode: Mode, root?: string): Promise<PromptResult> {
|
export async function prompt(mode: Mode, root?: string): Promise<PromptResult> {
|
||||||
let hasTs = false
|
let hasTs = false
|
||||||
if (mode === Mode.init) {
|
if (mode === Mode.init) {
|
||||||
@ -21,7 +30,7 @@ export async function prompt(mode: Mode, root?: string): Promise<PromptResult> {
|
|||||||
|
|
||||||
const result: PromptResult = await group({
|
const result: PromptResult = await group({
|
||||||
displayLang: async () => {
|
displayLang: async () => {
|
||||||
const locale = await osLocale()
|
const locale = osLocale()
|
||||||
|
|
||||||
if (locale === 'zh-CN' || locale === 'zh-Hans') {
|
if (locale === 'zh-CN' || locale === 'zh-Hans') {
|
||||||
setLang('zh-CN')
|
setLang('zh-CN')
|
||||||
|
|||||||
@ -2,16 +2,33 @@ import type { ResolvedData } from './types.js'
|
|||||||
import { kebabCase } from '@pengzhanbo/utils'
|
import { kebabCase } from '@pengzhanbo/utils'
|
||||||
import handlebars from 'handlebars'
|
import handlebars from 'handlebars'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extended resolved data with additional rendering information
|
||||||
|
*
|
||||||
|
* 扩展的解析数据,包含额外的渲染信息
|
||||||
|
*/
|
||||||
export interface RenderData extends ResolvedData {
|
export interface RenderData extends ResolvedData {
|
||||||
|
/** Project name in kebab-case / 项目名称(kebab-case 格式) */
|
||||||
name: string
|
name: string
|
||||||
|
/** Site name / 网站名称 */
|
||||||
siteName: string
|
siteName: string
|
||||||
|
/** Locale configuration array / 语言配置数组 */
|
||||||
locales: { path: string, lang: string, isEn: boolean, prefix: string }[]
|
locales: { path: string, lang: string, isEn: boolean, prefix: string }[]
|
||||||
|
/** Whether default language is English / 默认语言是否为英语 */
|
||||||
isEN: boolean
|
isEN: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
handlebars.registerHelper('removeLeadingSlash', (path: string) => path.replace(/^\//, ''))
|
handlebars.registerHelper('removeLeadingSlash', (path: string) => path.replace(/^\//, ''))
|
||||||
handlebars.registerHelper('equal', (a: string, b: string) => a === b)
|
handlebars.registerHelper('equal', (a: string, b: string) => a === b)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create render function with Handlebars template engine
|
||||||
|
*
|
||||||
|
* 使用 Handlebars 模板引擎创建渲染函数
|
||||||
|
*
|
||||||
|
* @param result - Resolved configuration data / 解析后的配置数据
|
||||||
|
* @returns Render function that processes Handlebars templates / 处理 Handlebars 模板的渲染函数
|
||||||
|
*/
|
||||||
export function createRender(result: ResolvedData) {
|
export function createRender(result: ResolvedData) {
|
||||||
const data: RenderData = {
|
const data: RenderData = {
|
||||||
...result,
|
...result,
|
||||||
|
|||||||
@ -11,6 +11,14 @@ import { prompt } from './prompt.js'
|
|||||||
import { t } from './translate.js'
|
import { t } from './translate.js'
|
||||||
import { getPackageManager } from './utils/index.js'
|
import { getPackageManager } from './utils/index.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the CLI workflow for VuePress project initialization or creation
|
||||||
|
*
|
||||||
|
* 执行 VuePress 项目初始化或创建的 CLI 工作流程
|
||||||
|
*
|
||||||
|
* @param mode - Operation mode (init or create) / 操作模式(初始化或创建)
|
||||||
|
* @param root - Root directory path / 根目录路径
|
||||||
|
*/
|
||||||
export async function run(mode: Mode, root?: string): Promise<void> {
|
export async function run(mode: Mode, root?: string): Promise<void> {
|
||||||
intro(colors.cyan('Welcome to VuePress and vuepress-theme-plume !'))
|
intro(colors.cyan('Welcome to VuePress and vuepress-theme-plume !'))
|
||||||
|
|
||||||
@ -70,6 +78,15 @@ export async function run(mode: Mode, root?: string): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolve prompt result into final configuration data.
|
||||||
|
*
|
||||||
|
* 将提示结果解析为最终配置数据。
|
||||||
|
*
|
||||||
|
* @param result - Prompt result from user input / 用户输入的提示结果
|
||||||
|
* @param mode - Operation mode (init or create) / 操作模式(初始化或创建)
|
||||||
|
* @returns Resolved configuration data / 解析后的配置数据
|
||||||
|
*/
|
||||||
function resolveData(result: PromptResult, mode: Mode): ResolvedData {
|
function resolveData(result: PromptResult, mode: Mode): ResolvedData {
|
||||||
return {
|
return {
|
||||||
...result,
|
...result,
|
||||||
|
|||||||
@ -6,6 +6,14 @@ interface Translate {
|
|||||||
t: (key: keyof Locale) => string
|
t: (key: keyof Locale) => string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a translate instance with specified language
|
||||||
|
*
|
||||||
|
* 创建指定语言的翻译实例
|
||||||
|
*
|
||||||
|
* @param lang - Language code / 语言代码
|
||||||
|
* @returns Translate interface / 翻译接口
|
||||||
|
*/
|
||||||
function createTranslate(lang?: Langs): Translate {
|
function createTranslate(lang?: Langs): Translate {
|
||||||
let current: Langs = lang || 'en-US'
|
let current: Langs = lang || 'en-US'
|
||||||
|
|
||||||
@ -19,5 +27,21 @@ function createTranslate(lang?: Langs): Translate {
|
|||||||
|
|
||||||
const translate = createTranslate()
|
const translate = createTranslate()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get translated string by key
|
||||||
|
*
|
||||||
|
* 根据键获取翻译后的字符串
|
||||||
|
*
|
||||||
|
* @param key - Locale key / 本地化键名
|
||||||
|
* @returns Translated string / 翻译后的字符串
|
||||||
|
*/
|
||||||
export const t: Translate['t'] = translate.t
|
export const t: Translate['t'] = translate.t
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set current language
|
||||||
|
*
|
||||||
|
* 设置当前语言
|
||||||
|
*
|
||||||
|
* @param lang - Language code to set / 要设置的语言代码
|
||||||
|
*/
|
||||||
export const setLang: Translate['setLang'] = translate.setLang
|
export const setLang: Translate['setLang'] = translate.setLang
|
||||||
|
|||||||
221
cli/src/types.ts
221
cli/src/types.ts
@ -1,57 +1,276 @@
|
|||||||
import type { DeployType } from './constants.js'
|
import type { DeployType } from './constants.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supported language codes for VuePress site
|
||||||
|
*
|
||||||
|
* VuePress 站点支持的语言代码
|
||||||
|
*/
|
||||||
export type Langs = 'zh-CN' | 'en-US'
|
export type Langs = 'zh-CN' | 'en-US'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Locale configuration for CLI prompts and messages
|
||||||
|
*
|
||||||
|
* CLI 提示和消息的国际化配置
|
||||||
|
*/
|
||||||
export interface Locale {
|
export interface Locale {
|
||||||
|
/**
|
||||||
|
* Question: Project root directory name
|
||||||
|
*
|
||||||
|
* 问题:项目根目录名称
|
||||||
|
*/
|
||||||
'question.root': string
|
'question.root': string
|
||||||
|
/**
|
||||||
|
* Question: Site name
|
||||||
|
*
|
||||||
|
* 问题:站点名称
|
||||||
|
*/
|
||||||
'question.site.name': string
|
'question.site.name': string
|
||||||
|
/**
|
||||||
|
* Question: Site description
|
||||||
|
*
|
||||||
|
* 问题:站点描述
|
||||||
|
*/
|
||||||
'question.site.description': string
|
'question.site.description': string
|
||||||
|
/**
|
||||||
|
* Question: Enable multi-language support
|
||||||
|
*
|
||||||
|
* 问题:启用多语言支持
|
||||||
|
*/
|
||||||
'question.multiLanguage': string
|
'question.multiLanguage': string
|
||||||
|
/**
|
||||||
|
* Question: Default language
|
||||||
|
*
|
||||||
|
* 问题:默认语言
|
||||||
|
*/
|
||||||
'question.defaultLanguage': string
|
'question.defaultLanguage': string
|
||||||
|
/**
|
||||||
|
* Question: Build tool bundler
|
||||||
|
*
|
||||||
|
* 问题:构建工具
|
||||||
|
*/
|
||||||
'question.bundler': string
|
'question.bundler': string
|
||||||
|
/**
|
||||||
|
* Question: Use TypeScript
|
||||||
|
*
|
||||||
|
* 问题:使用 TypeScript
|
||||||
|
*/
|
||||||
'question.useTs': string
|
'question.useTs': string
|
||||||
|
/**
|
||||||
|
* Question: Inject npm scripts
|
||||||
|
*
|
||||||
|
* 问题:注入 npm 脚本
|
||||||
|
*/
|
||||||
'question.injectNpmScripts': string
|
'question.injectNpmScripts': string
|
||||||
|
/**
|
||||||
|
* Question: Initialize git repository
|
||||||
|
*
|
||||||
|
* 问题:初始化 git 仓库
|
||||||
|
*/
|
||||||
'question.git': string
|
'question.git': string
|
||||||
|
/**
|
||||||
|
* Question: Deployment type
|
||||||
|
*
|
||||||
|
* 问题:部署类型
|
||||||
|
*/
|
||||||
'question.deploy': string
|
'question.deploy': string
|
||||||
|
/**
|
||||||
|
* Question: Install dependencies
|
||||||
|
*
|
||||||
|
* 问题:安装依赖
|
||||||
|
*/
|
||||||
'question.installDeps': string
|
'question.installDeps': string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spinner: Start message
|
||||||
|
*
|
||||||
|
* 加载动画:开始消息
|
||||||
|
*/
|
||||||
'spinner.start': string
|
'spinner.start': string
|
||||||
|
/**
|
||||||
|
* Spinner: Stop message
|
||||||
|
*
|
||||||
|
* 加载动画:停止消息
|
||||||
|
*/
|
||||||
'spinner.stop': string
|
'spinner.stop': string
|
||||||
|
/**
|
||||||
|
* Spinner: Git init message
|
||||||
|
*
|
||||||
|
* 加载动画:Git 初始化消息
|
||||||
|
*/
|
||||||
'spinner.git': string
|
'spinner.git': string
|
||||||
|
/**
|
||||||
|
* Spinner: Install message
|
||||||
|
*
|
||||||
|
* 加载动画:安装消息
|
||||||
|
*/
|
||||||
'spinner.install': string
|
'spinner.install': string
|
||||||
|
/**
|
||||||
|
* Spinner: Command hint message
|
||||||
|
*
|
||||||
|
* 加载动画:命令提示消息
|
||||||
|
*/
|
||||||
'spinner.command': string
|
'spinner.command': string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hint: Cancel operation
|
||||||
|
*
|
||||||
|
* 提示:取消操作
|
||||||
|
*/
|
||||||
'hint.cancel': string
|
'hint.cancel': string
|
||||||
|
/**
|
||||||
|
* Hint: Root directory
|
||||||
|
*
|
||||||
|
* 提示:根目录
|
||||||
|
*/
|
||||||
'hint.root': string
|
'hint.root': string
|
||||||
|
/**
|
||||||
|
* Hint: Illegal root directory name
|
||||||
|
*
|
||||||
|
* 提示:非法的根目录名称
|
||||||
|
*/
|
||||||
'hint.root.illegal': string
|
'hint.root.illegal': string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Package manager types
|
||||||
|
*
|
||||||
|
* 包管理器类型
|
||||||
|
*/
|
||||||
export type PackageManager = 'npm' | 'yarn' | 'pnpm'
|
export type PackageManager = 'npm' | 'yarn' | 'pnpm'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build tool bundler types
|
||||||
|
*
|
||||||
|
* 构建工具类型
|
||||||
|
*/
|
||||||
export type Bundler = 'vite' | 'webpack'
|
export type Bundler = 'vite' | 'webpack'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic options type for CLI prompts
|
||||||
|
*
|
||||||
|
* CLI 提示的通用选项类型
|
||||||
|
*
|
||||||
|
* @template Value - The value type for options
|
||||||
|
* @template Label - The label type for options
|
||||||
|
*/
|
||||||
export type Options<Value = string, Label = string> = { label: Label, value: Value }[]
|
export type Options<Value = string, Label = string> = { label: Label, value: Value }[]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File structure for generated project
|
||||||
|
*
|
||||||
|
* 生成项目的文件结构
|
||||||
|
*/
|
||||||
export interface File {
|
export interface File {
|
||||||
|
/**
|
||||||
|
* File path relative to project root
|
||||||
|
*
|
||||||
|
* 相对于项目根目录的文件路径
|
||||||
|
*/
|
||||||
filepath: string
|
filepath: string
|
||||||
|
/**
|
||||||
|
* File content
|
||||||
|
*
|
||||||
|
* 文件内容
|
||||||
|
*/
|
||||||
content: string
|
content: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Result from CLI prompts
|
||||||
|
*
|
||||||
|
* CLI 提示结果
|
||||||
|
*/
|
||||||
export interface PromptResult {
|
export interface PromptResult {
|
||||||
displayLang: string // cli display language
|
/**
|
||||||
|
* CLI display language
|
||||||
|
*
|
||||||
|
* CLI 显示语言
|
||||||
|
*/
|
||||||
|
displayLang: string
|
||||||
|
/**
|
||||||
|
* Project root directory name
|
||||||
|
*
|
||||||
|
* 项目根目录名称
|
||||||
|
*/
|
||||||
root: string
|
root: string
|
||||||
|
/**
|
||||||
|
* Site name
|
||||||
|
*
|
||||||
|
* 站点名称
|
||||||
|
*/
|
||||||
siteName: string
|
siteName: string
|
||||||
|
/**
|
||||||
|
* Site description
|
||||||
|
*
|
||||||
|
* 站点描述
|
||||||
|
*/
|
||||||
siteDescription: string
|
siteDescription: string
|
||||||
|
/**
|
||||||
|
* Build tool bundler
|
||||||
|
*
|
||||||
|
* 构建工具
|
||||||
|
*/
|
||||||
bundler: Bundler
|
bundler: Bundler
|
||||||
|
/**
|
||||||
|
* Enable multi-language support
|
||||||
|
*
|
||||||
|
* 启用多语言支持
|
||||||
|
*/
|
||||||
multiLanguage: boolean
|
multiLanguage: boolean
|
||||||
|
/**
|
||||||
|
* Default language
|
||||||
|
*
|
||||||
|
* 默认语言
|
||||||
|
*/
|
||||||
defaultLanguage: Langs
|
defaultLanguage: Langs
|
||||||
|
/**
|
||||||
|
* Use TypeScript
|
||||||
|
*
|
||||||
|
* 使用 TypeScript
|
||||||
|
*/
|
||||||
useTs: boolean
|
useTs: boolean
|
||||||
|
/**
|
||||||
|
* Inject npm scripts
|
||||||
|
*
|
||||||
|
* 注入 npm 脚本
|
||||||
|
*/
|
||||||
injectNpmScripts: boolean
|
injectNpmScripts: boolean
|
||||||
|
/**
|
||||||
|
* Deployment type
|
||||||
|
*
|
||||||
|
* 部署类型
|
||||||
|
*/
|
||||||
deploy: DeployType
|
deploy: DeployType
|
||||||
|
/**
|
||||||
|
* Initialize git repository
|
||||||
|
*
|
||||||
|
* 初始化 git 仓库
|
||||||
|
*/
|
||||||
git: boolean
|
git: boolean
|
||||||
|
/**
|
||||||
|
* Install dependencies
|
||||||
|
*
|
||||||
|
* 安装依赖
|
||||||
|
*/
|
||||||
install: boolean
|
install: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolved data after processing prompts
|
||||||
|
*
|
||||||
|
* 处理提示后的解析数据
|
||||||
|
*/
|
||||||
export interface ResolvedData extends PromptResult {
|
export interface ResolvedData extends PromptResult {
|
||||||
|
/**
|
||||||
|
* Selected package manager
|
||||||
|
*
|
||||||
|
* 选择的包管理器
|
||||||
|
*/
|
||||||
packageManager: PackageManager
|
packageManager: PackageManager
|
||||||
|
/**
|
||||||
|
* Documentation directory name
|
||||||
|
*
|
||||||
|
* 文档目录名称
|
||||||
|
*/
|
||||||
docsDir: string
|
docsDir: string
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,14 @@ import type { File } from '../types.js'
|
|||||||
import fs from 'node:fs/promises'
|
import fs from 'node:fs/promises'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read all files from a directory recursively
|
||||||
|
*
|
||||||
|
* 递归读取目录下的所有文件
|
||||||
|
*
|
||||||
|
* @param root - Root directory path to read from / 要读取的根目录路径
|
||||||
|
* @returns Array of file objects / 文件对象数组
|
||||||
|
*/
|
||||||
export async function readFiles(root: string): Promise<File[]> {
|
export async function readFiles(root: string): Promise<File[]> {
|
||||||
const filepaths = await fs.readdir(root, { recursive: true })
|
const filepaths = await fs.readdir(root, { recursive: true })
|
||||||
const files: File[] = []
|
const files: File[] = []
|
||||||
@ -18,6 +26,15 @@ export async function readFiles(root: string): Promise<File[]> {
|
|||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write files to target directory
|
||||||
|
*
|
||||||
|
* 将文件写入目标目录
|
||||||
|
*
|
||||||
|
* @param files - Array of file objects to write / 要写入的文件对象数组
|
||||||
|
* @param target - Target directory path / 目标目录路径
|
||||||
|
* @param rewrite - Optional function to rewrite file paths / 可选的文件路径重写函数
|
||||||
|
*/
|
||||||
export async function writeFiles(
|
export async function writeFiles(
|
||||||
files: File[],
|
files: File[],
|
||||||
target: string,
|
target: string,
|
||||||
@ -32,6 +49,14 @@ export async function writeFiles(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read and parse JSON file
|
||||||
|
*
|
||||||
|
* 读取并解析 JSON 文件
|
||||||
|
*
|
||||||
|
* @param filepath - Path to JSON file / JSON 文件路径
|
||||||
|
* @returns Parsed JSON object or null if parsing fails / 解析后的 JSON 对象,解析失败返回 null
|
||||||
|
*/
|
||||||
export async function readJsonFile<T extends Record<string, any> = Record<string, any>>(filepath: string): Promise<T | null> {
|
export async function readJsonFile<T extends Record<string, any> = Record<string, any>>(filepath: string): Promise<T | null> {
|
||||||
try {
|
try {
|
||||||
const content = await fs.readFile(filepath, 'utf-8')
|
const content = await fs.readFile(filepath, 'utf-8')
|
||||||
|
|||||||
@ -1,6 +1,19 @@
|
|||||||
import type { PackageManager } from '../types.js'
|
import type { PackageManager } from '../types.js'
|
||||||
import process from 'node:process'
|
import process from 'node:process'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detect the current package manager from environment variables.
|
||||||
|
*
|
||||||
|
* 从环境变量检测当前使用的包管理器。
|
||||||
|
*
|
||||||
|
* @returns The detected package manager name / 检测到的包管理器名称
|
||||||
|
* @example
|
||||||
|
* // When using pnpm
|
||||||
|
* const pm = getPackageManager() // returns 'pnpm'
|
||||||
|
*
|
||||||
|
* // When using npm
|
||||||
|
* const pm = getPackageManager() // returns 'npm'
|
||||||
|
*/
|
||||||
export function getPackageManager(): PackageManager {
|
export function getPackageManager(): PackageManager {
|
||||||
const name = process.env?.npm_config_user_agent || 'npm'
|
const name = process.env?.npm_config_user_agent || 'npm'
|
||||||
return name.split('/')[0] as PackageManager
|
return name.split('/')[0] as PackageManager
|
||||||
|
|||||||
@ -3,8 +3,24 @@ import { fileURLToPath } from 'node:url'
|
|||||||
|
|
||||||
export const __dirname: string = path.dirname(fileURLToPath(import.meta.url))
|
export const __dirname: string = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolve path relative to the project root
|
||||||
|
*
|
||||||
|
* 相对于项目根目录解析路径
|
||||||
|
*
|
||||||
|
* @param args - Path segments to resolve / 要解析的路径段
|
||||||
|
* @returns Resolved absolute path / 解析后的绝对路径
|
||||||
|
*/
|
||||||
export const resolve = (...args: string[]): string => path.resolve(__dirname, '../', ...args)
|
export const resolve = (...args: string[]): string => path.resolve(__dirname, '../', ...args)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get template directory path
|
||||||
|
*
|
||||||
|
* 获取模板目录路径
|
||||||
|
*
|
||||||
|
* @param dir - Subdirectory name within templates / templates 中的子目录名称
|
||||||
|
* @returns Resolved template directory path / 解析后的模板目录路径
|
||||||
|
*/
|
||||||
export const getTemplate = (dir: string): string => resolve('templates', dir)
|
export const getTemplate = (dir: string): string => resolve('templates', dir)
|
||||||
|
|
||||||
export * from './fs.js'
|
export * from './fs.js'
|
||||||
|
|||||||
@ -81,7 +81,7 @@ content right
|
|||||||
|
|
||||||
**demo wrapper:**
|
**demo wrapper:**
|
||||||
|
|
||||||
::: demo-wrapper title="Demo" no-padding height="200px"
|
::: window title="Demo" height="200px"
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.open-door {
|
.open-door {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -95,9 +95,9 @@ H~2~O
|
|||||||
- vscode - <Icon name="skill-icons:vscode-dark" size="2em" />
|
- vscode - <Icon name="skill-icons:vscode-dark" size="2em" />
|
||||||
- twitter - <Icon name="skill-icons:twitter" size="2em" />
|
- twitter - <Icon name="skill-icons:twitter" size="2em" />
|
||||||
|
|
||||||
**demo wrapper:**
|
**示例容器:**
|
||||||
|
|
||||||
::: demo-wrapper title="示例" no-padding height="200px"
|
::: window title="示例" height="200px"
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.open-door {
|
.open-door {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -69,6 +69,7 @@ export const themeGuide: ThemeCollectionItem = defineCollection({
|
|||||||
'chat',
|
'chat',
|
||||||
'include',
|
'include',
|
||||||
'env',
|
'env',
|
||||||
|
'obsidian',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,6 +69,7 @@ export const themeGuide: ThemeCollectionItem = defineCollection({
|
|||||||
'chat',
|
'chat',
|
||||||
'include',
|
'include',
|
||||||
'env',
|
'env',
|
||||||
|
'obsidian',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -94,7 +94,7 @@ export const enNavbar: ThemeNavItem[] = defineNavbarConfig([
|
|||||||
{
|
{
|
||||||
text: `${version}`,
|
text: `${version}`,
|
||||||
icon: 'codicon:versions',
|
icon: 'codicon:versions',
|
||||||
badge: '新',
|
badge: 'New',
|
||||||
items: [
|
items: [
|
||||||
{ text: 'Changelog', link: '/en/changelog/' },
|
{ text: 'Changelog', link: '/en/changelog/' },
|
||||||
{ text: 'Contributing', link: '/en/contributing/' },
|
{ text: 'Contributing', link: '/en/contributing/' },
|
||||||
|
|||||||
@ -58,6 +58,7 @@ export const theme: Theme = plumeTheme({
|
|||||||
jsfiddle: true,
|
jsfiddle: true,
|
||||||
demo: true,
|
demo: true,
|
||||||
encrypt: true,
|
encrypt: true,
|
||||||
|
obsidian: true,
|
||||||
npmTo: ['pnpm', 'yarn', 'npm'],
|
npmTo: ['pnpm', 'yarn', 'npm'],
|
||||||
repl: {
|
repl: {
|
||||||
go: true,
|
go: true,
|
||||||
|
|||||||
@ -5,7 +5,7 @@ config:
|
|||||||
-
|
-
|
||||||
type: hero
|
type: hero
|
||||||
full: true
|
full: true
|
||||||
effect: lightning
|
effect: hyper-speed
|
||||||
forceDark: true
|
forceDark: true
|
||||||
hero:
|
hero:
|
||||||
name: Theme Plume
|
name: Theme Plume
|
||||||
|
|||||||
@ -401,7 +401,7 @@ end tell
|
|||||||
在代码块里面, `&` 、 `<` 和 `>` 会自动转成 HTML 实体,这样的方式让你非常容易使用 Markdown 插入范例用的 HTML 原始码,只需要复制粘贴,再加上缩进就可以了,剩下的 Markdown 都会帮你处理,例如:
|
在代码块里面, `&` 、 `<` 和 `>` 会自动转成 HTML 实体,这样的方式让你非常容易使用 Markdown 插入范例用的 HTML 原始码,只需要复制粘贴,再加上缩进就可以了,剩下的 Markdown 都会帮你处理,例如:
|
||||||
|
|
||||||
````md
|
````md
|
||||||
```
|
```html
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
© 2004 Foo Corporation
|
© 2004 Foo Corporation
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -239,7 +239,7 @@ Shiki 支持多种编程语言。需要做的就是将有效的语言别名附
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
name: 'MyComponent',
|
name: 'MyComponent',
|
||||||
@ -248,7 +248,7 @@ export default {
|
|||||||
```
|
```
|
||||||
````
|
````
|
||||||
|
|
||||||
````
|
````md
|
||||||
```html
|
```html
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="todo in todos" :key="todo.id">
|
<li v-for="todo in todos" :key="todo.id">
|
||||||
@ -281,7 +281,7 @@ export default {
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js{4}
|
```js{4}
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
@ -313,7 +313,7 @@ export default {
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js{1,4,6-8}
|
```js{1,4,6-8}
|
||||||
export default { // Highlighted
|
export default { // Highlighted
|
||||||
data () {
|
data () {
|
||||||
@ -349,10 +349,10 @@ export default { // Highlighted
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
msg: 'Highlighted!' // [\!code highlight]
|
msg: 'Highlighted!' // [\!code highlight]
|
||||||
}
|
}
|
||||||
@ -381,10 +381,10 @@ export default {
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
msg: 'Focused!' // [\!code focus]
|
msg: 'Focused!' // [\!code focus]
|
||||||
}
|
}
|
||||||
@ -411,10 +411,10 @@ export default {
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
remove: 'Removed', // [\!code --]
|
remove: 'Removed', // [\!code --]
|
||||||
add: 'Added' // [\!code ++]
|
add: 'Added' // [\!code ++]
|
||||||
@ -443,10 +443,10 @@ export default {
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
error: 'Error', // [\!code error]
|
error: 'Error', // [\!code error]
|
||||||
warning: 'Warning' // [\!code warning]
|
warning: 'Warning' // [\!code warning]
|
||||||
@ -473,7 +473,7 @@ export default {
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```ts
|
```ts
|
||||||
export function foo() { // [\!code word:Hello]
|
export function foo() { // [\!code word:Hello]
|
||||||
const msg = 'Hello World'
|
const msg = 'Hello World'
|
||||||
@ -495,7 +495,7 @@ export function foo() { // [!code word:Hello]
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```ts
|
```ts
|
||||||
// [\!code word:options:2]
|
// [\!code word:options:2]
|
||||||
const options = { foo: 'bar' }
|
const options = { foo: 'bar' }
|
||||||
@ -613,7 +613,7 @@ export default config
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
|
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
|
||||||
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
|
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
|
||||||
|
|
||||||
@ -711,7 +711,7 @@ vuepress-theme-plume 是一个 ==简洁美观== 的 主题
|
|||||||
这将为图片添加 一个 名为 `full-width` 的 class 属性,以及一个 `width` 属性,值为 `100%`。
|
这将为图片添加 一个 名为 `full-width` 的 class 属性,以及一个 `width` 属性,值为 `100%`。
|
||||||
|
|
||||||
```md
|
```md
|
||||||
{.full-width width="100%"}
|
{.full-width width="100%"}
|
||||||
```
|
```
|
||||||
|
|
||||||
同时也支持其他属性:
|
同时也支持其他属性:
|
||||||
|
|||||||
@ -102,9 +102,9 @@ H~2~O
|
|||||||
- vscode - <Icon name="skill-icons:vscode-dark" size="2em" />
|
- vscode - <Icon name="skill-icons:vscode-dark" size="2em" />
|
||||||
- twitter - <Icon name="skill-icons:twitter" size="2em" />
|
- twitter - <Icon name="skill-icons:twitter" size="2em" />
|
||||||
|
|
||||||
**demo wrapper:**
|
**示例容器:**
|
||||||
|
|
||||||
::: demo-wrapper title="示例" no-padding height="200px"
|
::: window title="示例" height="200px"
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.open-door {
|
.open-door {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -266,7 +266,7 @@ books:
|
|||||||
- 1984:
|
- 1984:
|
||||||
author: *gOrwell
|
author: *gOrwell
|
||||||
- animal-farm:
|
- animal-farm:
|
||||||
author: *gOrwell
|
author:*gOrwell
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,7 @@ export default defineUserConfig({
|
|||||||
|
|
||||||
主题提供了 `plume.config.ts` 配置文件,==对该文件的修改支持热更新,无需重启服务=={.tip} ::twemoji:confetti-ball::。
|
主题提供了 `plume.config.ts` 配置文件,==对该文件的修改支持热更新,无需重启服务=={.tip} ::twemoji:confetti-ball::。
|
||||||
|
|
||||||
你可以在其中配置支持热更新的字段,如 `navbar`、`profile` 等。
|
您可以在其中配置支持热更新的字段,如 `navbar`、`profile` 等。
|
||||||
|
|
||||||
::: tip
|
::: tip
|
||||||
这些字段仍可在 VuePress 配置文件的 `theme` 中配置,但主题配置文件的设置最终会合并到主配置中。
|
这些字段仍可在 VuePress 配置文件的 `theme` 中配置,但主题配置文件的设置最终会合并到主配置中。
|
||||||
|
|||||||
@ -6,7 +6,7 @@ permalink: /config/locales/
|
|||||||
|
|
||||||
这些选项用于配置与语言相关的文本。
|
这些选项用于配置与语言相关的文本。
|
||||||
|
|
||||||
如果你的站点是以非内置语言支持以外的其他语言提供服务的,你应该为每个语言设置这些选项来提供翻译。
|
如果您的站点是以非内置语言支持以外的其他语言提供服务的,您应该为每个语言设置这些选项来提供翻译。
|
||||||
|
|
||||||
## 内置语言支持
|
## 内置语言支持
|
||||||
|
|
||||||
|
|||||||
@ -149,7 +149,7 @@ export default defineUserConfig({
|
|||||||
- **默认值**: `{ provider: 'iconify' }`
|
- **默认值**: `{ provider: 'iconify' }`
|
||||||
- **详情**: 图标配置
|
- **详情**: 图标配置
|
||||||
|
|
||||||
[查看 **icon** 使用说明](../../theme/guide/features/icon.md){.read-more}
|
[查看 **icon** 使用说明](../guide/features/icon.md){.read-more}
|
||||||
|
|
||||||
### plot
|
### plot
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ permalink: /config/navigation/
|
|||||||
|
|
||||||
主题默认会自动生成最简单的导航栏配置,仅包括 **首页** 和 **文章列表页** 。
|
主题默认会自动生成最简单的导航栏配置,仅包括 **首页** 和 **文章列表页** 。
|
||||||
|
|
||||||
你也可以自己配置导航栏,覆盖默认的的导航栏配置。
|
您也可以自己配置导航栏,覆盖默认的导航栏配置。
|
||||||
|
|
||||||
默认配置如下:
|
默认配置如下:
|
||||||
|
|
||||||
|
|||||||
@ -82,6 +82,7 @@ interface SearchBoxLocale {
|
|||||||
### 启用
|
### 启用
|
||||||
|
|
||||||
```ts title=".vuepress/config.ts" twoslash
|
```ts title=".vuepress/config.ts" twoslash
|
||||||
|
// @errors: 2353
|
||||||
import { defineUserConfig } from 'vuepress'
|
import { defineUserConfig } from 'vuepress'
|
||||||
import { plumeTheme } from 'vuepress-theme-plume'
|
import { plumeTheme } from 'vuepress-theme-plume'
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ permalink: /config/watermark/
|
|||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
```ts title=".vuepress/config.ts" twoslash
|
```ts title=".vuepress/config.ts" twoslash
|
||||||
|
// @errors: 7006
|
||||||
import { defineUserConfig } from 'vuepress'
|
import { defineUserConfig } from 'vuepress'
|
||||||
import { plumeTheme } from 'vuepress-theme-plume'
|
import { plumeTheme } from 'vuepress-theme-plume'
|
||||||
|
|
||||||
|
|||||||
@ -14,8 +14,7 @@ permalink: /config/theme/
|
|||||||
::: warning 该字段不支持在 [主题配置文件 `plume.config.js`](./intro.md#主题配置文件) 中进行配置。
|
::: warning 该字段不支持在 [主题配置文件 `plume.config.js`](./intro.md#主题配置文件) 中进行配置。
|
||||||
:::
|
:::
|
||||||
|
|
||||||
无以上声明的字段,你可以在 `.vuepress/config.ts` 或者 `.vuepress/plume.config.ts` 的任意一个文件中
|
无以上声明的字段,您可以在 `.vuepress/config.ts` 或者 `.vuepress/plume.config.ts` 的任意一个文件中进行配置,一般情况下建议在 `.vuepress/plume.config.ts` 中进行配置。
|
||||||
进行配置,一般情况下建议在 `.vuepress/plume.config.ts` 中进行配置。
|
|
||||||
|
|
||||||
::: warning 已经在一个配置文件中进行配置的字段,尽量不要在另一个配置文件中重复配置
|
::: warning 已经在一个配置文件中进行配置的字段,尽量不要在另一个配置文件中重复配置
|
||||||
:::
|
:::
|
||||||
@ -441,9 +440,9 @@ export default defineUserConfig({
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
[你可以在这里查看 **simple-icons** 所有可用图标](https://icon-sets.iconify.design/simple-icons/){.readmore}
|
[您可以在这里查看 **simple-icons** 所有可用图标](https://icon-sets.iconify.design/simple-icons/){.readmore}
|
||||||
|
|
||||||
如果 **Iconify** 无法满足你的需求,可以传入 `{ svg: string, name?: string }`的格式,使用自定义图标,传入 svg 源码字符串,可选 `name` 字段,用于配置 [`navbarSocialInclude`](#navbarsocialinclude)
|
如果 **Iconify** 无法满足您的需求,可以传入 `{ svg: string, name?: string }` 格式使用自定义图标,传入 SVG 源码字符串,可选 `name` 字段用于配置 [`navbarSocialInclude`](#navbarsocialinclude)
|
||||||
|
|
||||||
示例:
|
示例:
|
||||||
|
|
||||||
|
|||||||
@ -28,9 +28,9 @@ docs:
|
|||||||
-
|
-
|
||||||
name: 哦麦 MC
|
name: 哦麦 MC
|
||||||
desc: 我的世界教学文档。
|
desc: 我的世界教学文档。
|
||||||
logo: https://static.ohmymc.com/img/minecraft-154749_1280.png?max_width=1920&max_height=1920
|
logo: https://s.xc.life/img/img/minecraft-154749_1280.png
|
||||||
url: https://ohmymc.com/
|
url: https://ohmymc.com/
|
||||||
preview: https://static.ohmymc.com/img/20241228225159139.png?max_width=1920&max_height=1920
|
preview: https://s.xc.life/img/img/20241228225159139.png
|
||||||
-
|
-
|
||||||
name: NcatBotDocs
|
name: NcatBotDocs
|
||||||
desc: NcatBot,一个 QQ 机器人框架项目的使用文档。
|
desc: NcatBot,一个 QQ 机器人框架项目的使用文档。
|
||||||
@ -93,6 +93,12 @@ docs:
|
|||||||
logo: https://official.skycraft.cn/i/3.jpg
|
logo: https://official.skycraft.cn/i/3.jpg
|
||||||
url: https://docs.skycraft.cn/
|
url: https://docs.skycraft.cn/
|
||||||
preview: https://bbsimage.skycraft.cn/docs-preview.jpg
|
preview: https://bbsimage.skycraft.cn/docs-preview.jpg
|
||||||
|
-
|
||||||
|
name: mcenahle Docs
|
||||||
|
desc: mcenahle 的文档网站。
|
||||||
|
logo: https://d.mcenahle.cn/images/logo.png
|
||||||
|
url: https://d.mcenahle.cn/
|
||||||
|
preview: https://mcenahle.cn/resources/docs-site-preview.jpg
|
||||||
|
|
||||||
blog:
|
blog:
|
||||||
-
|
-
|
||||||
@ -218,9 +224,9 @@ blog:
|
|||||||
name: 𝙁𝙡𝙖𝙨𝙝
|
name: 𝙁𝙡𝙖𝙨𝙝
|
||||||
desc: 路漫漫其修远兮,吾将上下而求索
|
desc: 路漫漫其修远兮,吾将上下而求索
|
||||||
logo: https://haipeng-lin.cn/images/avatar.jpg
|
logo: https://haipeng-lin.cn/images/avatar.jpg
|
||||||
url: https://haipeng-lin.cn
|
url: https://blog.haipeng-lin.cn
|
||||||
repo: https://gitee.com/linhaipengg
|
repo: https://gitee.com/linhaipengg
|
||||||
preview: https://img.haipeng-lin.cn/1768622018580.png
|
preview: https://img.haipeng-lin.cn/index.webp
|
||||||
-
|
-
|
||||||
name: PinkDopeyBug
|
name: PinkDopeyBug
|
||||||
desc: 山难现浮槎,心易陷镜花。
|
desc: 山难现浮槎,心易陷镜花。
|
||||||
@ -269,6 +275,13 @@ blog:
|
|||||||
logo: https://raw.githubusercontent.com/Konata9/pic-base/main/pics/20260126223726455.png
|
logo: https://raw.githubusercontent.com/Konata9/pic-base/main/pics/20260126223726455.png
|
||||||
url: https://konata9.cc/
|
url: https://konata9.cc/
|
||||||
preview: https://raw.githubusercontent.com/Konata9/pic-base/main/pics/20260125225910673.webp
|
preview: https://raw.githubusercontent.com/Konata9/pic-base/main/pics/20260125225910673.webp
|
||||||
|
-
|
||||||
|
name: Esyka
|
||||||
|
desc: Esyka's Blog
|
||||||
|
logo: https://www.esyka.top/images/logo.png
|
||||||
|
url: https://www.esyka.top/
|
||||||
|
repo: https://github.com/esyka114514
|
||||||
|
preview: https://www.esyka.top/images/preview.png
|
||||||
---
|
---
|
||||||
|
|
||||||
:::important
|
:::important
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
---
|
---
|
||||||
pageLayout: home
|
pageLayout: home
|
||||||
|
title: Vuepress Theme Plume
|
||||||
config:
|
config:
|
||||||
-
|
-
|
||||||
type: hero
|
type: hero
|
||||||
full: true
|
full: true
|
||||||
effect: lightning
|
effect: hyper-speed
|
||||||
forceDark: true
|
forceDark: true
|
||||||
hero:
|
hero:
|
||||||
name: Theme Plume
|
name: Theme Plume
|
||||||
@ -37,7 +38,7 @@ config:
|
|||||||
-
|
-
|
||||||
title: Multi-language
|
title: Multi-language
|
||||||
icon: twemoji:balance-scale
|
icon: twemoji:balance-scale
|
||||||
details: Built-in support for Chinese/English, and you can customize and add more language support
|
details: Built-in support for 7 languages including Chinese and English, and you can customize and add more language support
|
||||||
-
|
-
|
||||||
title: Dual Color Theme
|
title: Dual Color Theme
|
||||||
icon: twemoji:cityscape
|
icon: twemoji:cityscape
|
||||||
@ -57,7 +58,7 @@ config:
|
|||||||
-
|
-
|
||||||
title: Markdown Enhancement
|
title: Markdown Enhancement
|
||||||
icon: twemoji:writing-hand-light-skin-tone
|
icon: twemoji:writing-hand-light-skin-tone
|
||||||
details: Supports Markdown syntax, code block grouping, hint containers, task lists, mathematical formulas, code demonstrations, etc.
|
details: Based on regular markdown syntax, adds dozens of enhanced syntaxes such as custom containers, file trees, code groups, etc.
|
||||||
-
|
-
|
||||||
type: image-text
|
type: image-text
|
||||||
title: Features
|
title: Features
|
||||||
@ -69,7 +70,7 @@ config:
|
|||||||
description: Add tags, categories, word count, reading time, writing date, and other information to articles.
|
description: Add tags, categories, word count, reading time, writing date, and other information to articles.
|
||||||
-
|
-
|
||||||
title: Comments
|
title: Comments
|
||||||
description: Supports 4 comment systems: Giscus, Waline, Twikoo, Artalk<br>You can freely choose the comment system that suits your needs.
|
description: "Supports 4 comment systems: Giscus, Waline, Twikoo, Artalk<br>You can freely choose the comment system that suits your needs."
|
||||||
-
|
-
|
||||||
title: Search
|
title: Search
|
||||||
description: Supports local search based on minisearch, and also supports Algolia search.
|
description: Supports local search based on minisearch, and also supports Algolia search.
|
||||||
@ -81,7 +82,7 @@ config:
|
|||||||
description: Code copying, CodePen demonstration, JSFiddle demonstration, CodeSandbox demonstration, code groups, line highlighting, line focusing, line warnings, difference comparison, code block folding, etc.
|
description: Code copying, CodePen demonstration, JSFiddle demonstration, CodeSandbox demonstration, code groups, line highlighting, line focusing, line warnings, difference comparison, code block folding, etc.
|
||||||
-
|
-
|
||||||
title: Resource Embedding
|
title: Resource Embedding
|
||||||
description: Charts:chart.js/ECharts/Mermaid/flowchart<br>Videos:Bilibili/Youtube/ArtPlayer<br>PDF, 200K+ Iconify icons
|
description: "Charts: chart.js/ECharts/Mermaid/flowchart<br>Videos: Bilibili/Youtube/ArtPlayer<br>PDF, 200K+ Iconify icons"
|
||||||
-
|
-
|
||||||
type: text-image
|
type: text-image
|
||||||
title: Blog
|
title: Blog
|
||||||
@ -116,64 +117,48 @@ config:
|
|||||||
<div style="max-width: 960px;margin:0 auto;" class="home-custom-content">
|
<div style="max-width: 960px;margin:0 auto;" class="home-custom-content">
|
||||||
|
|
||||||
::: center
|
::: center
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||

|
{.no-view}
|
||||||

|
{.no-view}
|
||||||
|
{.no-view}
|
||||||
|
{.no-view}
|
||||||
|
{.no-view}
|
||||||
|
|
||||||
|
{.no-view}
|
||||||
|
{.no-view}
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Installation
|
### Usage
|
||||||
|
|
||||||
:::code-tabs
|
Use the following command to quickly create a new ==VuePress== project using this theme.
|
||||||
@tab pnpm
|
|
||||||
|
:::npm-to
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm add vuepress@next vuepress-theme-plume vue
|
npm create vuepress-theme-plume@latest
|
||||||
```
|
|
||||||
|
|
||||||
@tab npm
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install vuepress@next vuepress-theme-plume
|
|
||||||
```
|
|
||||||
|
|
||||||
@tab yarn
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn add vuepress@next vuepress-theme-plume
|
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Configuration
|
### Start the project
|
||||||
|
|
||||||
::: code-tabs
|
::: npm-to
|
||||||
@tab .vuepress/config.ts
|
|
||||||
|
|
||||||
```ts :no-line-numbers
|
```sh
|
||||||
import { defineUserConfig } from 'vuepress'
|
npm run docs:dev
|
||||||
import { plumeTheme } from 'vuepress-theme-plume'
|
|
||||||
|
|
||||||
export default defineUserConfig({
|
|
||||||
// vuepress config...
|
|
||||||
theme: plumeTheme({
|
|
||||||
// theme config...
|
|
||||||
})
|
|
||||||
})
|
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Update Log
|
### Changelog
|
||||||
|
|
||||||
[Changelog](../changelog)
|
[Changelog](./changelog)
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
|
Thanks to all contributors!
|
||||||
|
|
||||||
<Contributors :contributors="data" />
|
<Contributors :contributors="data" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -269,7 +269,7 @@ books:
|
|||||||
- 1984:
|
- 1984:
|
||||||
author: *gOrwell
|
author: *gOrwell
|
||||||
- animal-farm:
|
- animal-farm:
|
||||||
author: *gOrwell
|
author:*gOrwell
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -124,8 +124,8 @@ export default defineUserConfig({
|
|||||||
'/': {
|
'/': {
|
||||||
// Chinese collection configuration // [!code focus:4]
|
// Chinese collection configuration // [!code focus:4]
|
||||||
collections: [
|
collections: [
|
||||||
{ type: 'post', dir: 'blog', title: '博客' },
|
{ type: 'post', dir: 'blog', title: 'Blog' },
|
||||||
{ type: 'doc', dir: 'typescript', title: 'TypeScript笔记', sidebar: 'auto' }
|
{ type: 'doc', dir: 'typescript', title: 'TypeScript Notes', sidebar: 'auto' }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'/en/': {
|
'/en/': {
|
||||||
@ -150,8 +150,8 @@ export default defineThemeConfig({
|
|||||||
'/': {
|
'/': {
|
||||||
// Chinese collection configuration // [!code focus:4]
|
// Chinese collection configuration // [!code focus:4]
|
||||||
collections: [
|
collections: [
|
||||||
{ type: 'post', dir: 'blog', title: '博客' },
|
{ type: 'post', dir: 'blog', title: 'Blog' },
|
||||||
{ type: 'doc', dir: 'typescript', title: 'TypeScript笔记', sidebar: 'auto' }
|
{ type: 'doc', dir: 'typescript', title: 'TypeScript Notes', sidebar: 'auto' }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'/en/': {
|
'/en/': {
|
||||||
|
|||||||
@ -159,7 +159,7 @@ The `include` configuration is implemented by the
|
|||||||
- **Default:** `{ provider: 'iconify' }`
|
- **Default:** `{ provider: 'iconify' }`
|
||||||
- **Details:** Icon configuration.
|
- **Details:** Icon configuration.
|
||||||
|
|
||||||
[View **icon** usage instructions](../../theme/guide/features/icon.md){.read-more}
|
[View **icon** usage instructions](../guide/features/icon.md){.read-more}
|
||||||
|
|
||||||
### plot
|
### plot
|
||||||
|
|
||||||
|
|||||||
@ -82,6 +82,7 @@ Refer to [Algolia DocSearch Reference](/guide/features/content-search/#algolia-d
|
|||||||
### Enable
|
### Enable
|
||||||
|
|
||||||
```ts title=".vuepress/config.ts" twoslash
|
```ts title=".vuepress/config.ts" twoslash
|
||||||
|
// @errors: 2353
|
||||||
import { defineUserConfig } from 'vuepress'
|
import { defineUserConfig } from 'vuepress'
|
||||||
import { plumeTheme } from 'vuepress-theme-plume'
|
import { plumeTheme } from 'vuepress-theme-plume'
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ Related plugin: [@vuepress/plugin-watermark](https://ecosystem.vuejs.press/zh/pl
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```ts title=".vuepress/config.ts" twoslash
|
```ts title=".vuepress/config.ts" twoslash
|
||||||
|
// @errors: 7006
|
||||||
import { defineUserConfig } from 'vuepress'
|
import { defineUserConfig } from 'vuepress'
|
||||||
import { plumeTheme } from 'vuepress-theme-plume'
|
import { plumeTheme } from 'vuepress-theme-plume'
|
||||||
|
|
||||||
|
|||||||
294
docs/en/demos.md
Normal file
294
docs/en/demos.md
Normal file
@ -0,0 +1,294 @@
|
|||||||
|
---
|
||||||
|
title: Demos
|
||||||
|
createTime: 2025/10/08 19:22:07
|
||||||
|
permalink: /en/demos/
|
||||||
|
readingTime: false
|
||||||
|
prev: false
|
||||||
|
next: false
|
||||||
|
article: false
|
||||||
|
externalLinkIcon: false
|
||||||
|
contributors: false
|
||||||
|
changelog: false
|
||||||
|
search: false
|
||||||
|
docs:
|
||||||
|
-
|
||||||
|
name: VuePress Plume
|
||||||
|
desc: A simple, feature-rich VuePress documentation & blog theme.
|
||||||
|
logo: /plume.png
|
||||||
|
url: https://theme-plume.vuejs.press
|
||||||
|
repo: https://github.com/pengzhanbo/vuepress-theme-plume
|
||||||
|
preview: /images/demos/plume.jpg
|
||||||
|
-
|
||||||
|
name: city walk
|
||||||
|
desc: An open data platform dedicated to gathering outdoor activity locations and cultural venues from over 350 cities across the country.
|
||||||
|
logo: https://pub-187e90a3327b41ccb8869558b6b8bbc0.r2.dev/city-shenzhen/2024/12/0a08e9417033ccaf116fb71cfc7bcdb9.png
|
||||||
|
url: https://shenzhen.citywalk.group/
|
||||||
|
repo: https://github.com/sunshang-hl/CityWalk
|
||||||
|
preview: https://pub-187e90a3327b41ccb8869558b6b8bbc0.r2.dev/city-shenzhen/2024/12/ed251c4438f722dffd6cb95db86c0d56.jpg
|
||||||
|
-
|
||||||
|
name: Oh My MC
|
||||||
|
desc: Minecraft tutorial documentation.
|
||||||
|
logo: https://static.ohmymc.com/img/minecraft-154749_1280.png?max_width=1920&max_height=1920
|
||||||
|
url: https://ohmymc.com/
|
||||||
|
preview: https://static.ohmymc.com/img/20241228225159139.png?max_width=1920&max_height=1920
|
||||||
|
-
|
||||||
|
name: NcatBotDocs
|
||||||
|
desc: Documentation for NcatBot, a QQ bot framework project.
|
||||||
|
logo: https://docs.ncatbot.xyz/images/logo.png
|
||||||
|
url: https://docs.ncatbot.xyz
|
||||||
|
repo: https://github.com/Isaaczhr/NcatBotDocs
|
||||||
|
preview: https://docs.ncatbot.xyz/images/preview.jpg
|
||||||
|
-
|
||||||
|
name: PGuide Docs
|
||||||
|
desc: A localized university guide related to self-study in computer science, campus life, and open public services.
|
||||||
|
logo: https://docs.pguide.studio/logo.svg
|
||||||
|
url: https://docs.pguide.studio
|
||||||
|
repo: https://github.com/PGuideDev/PGuide-Docs
|
||||||
|
preview: https://cos-global.pguide.cloud/pguide-docs/src/pguide-doc.png
|
||||||
|
-
|
||||||
|
name: Documentation Center | Shougan Interactive
|
||||||
|
desc: Shougan Interactive is a professional platform for live questions, voting, and large-screen interactions, providing one-stop interactive solutions for lecturers, hosts, and conference organizers
|
||||||
|
logo: https://docs.shougan.net/images/logo.png
|
||||||
|
url: https://docs.shougan.net
|
||||||
|
repo: https://github.com/SuJingnan/vuepress-theme-plume
|
||||||
|
preview: https://docs.shougan.net/images/docs-proview.png
|
||||||
|
-
|
||||||
|
name: Search-Rec-Ads Cosmos Explorer
|
||||||
|
desc: Explore the fascinating universe of search, recommendation, and advertising algorithms
|
||||||
|
logo: https://raw.githubusercontent.com/1985312383/search-rec-ads-cosmos-explorer/refs/heads/main/docs/.vuepress/public/img/favicon.png
|
||||||
|
url: https://1985312383.github.io/search-rec-ads-cosmos-explorer/
|
||||||
|
repo: https://github.com/1985312383/search-rec-ads-cosmos-explorer
|
||||||
|
preview: https://raw.githubusercontent.com/1985312383/search-rec-ads-cosmos-explorer/refs/heads/main/docs/.vuepress/public/img/preview.jpg
|
||||||
|
-
|
||||||
|
name: MaaAssistantArknights Documentation Site
|
||||||
|
desc: Arknights assistant, automatic farming, smart base shifts, one-click daily tasks
|
||||||
|
logo: https://cdn.jsdelivr.net/gh/MaaAssistantArknights/design@main/logo/maa-logo_128x128.jpg
|
||||||
|
url: https://docs.maa.plus
|
||||||
|
repo: https://github.com/MaaAssistantArknights/MaaAssistantArknights/tree/dev/docs
|
||||||
|
preview: https://docs.maa.plus/images/preview.jpg
|
||||||
|
-
|
||||||
|
name: Python Beginner Docs
|
||||||
|
desc: Beginner-friendly Python 3 documentation
|
||||||
|
logo: https://python.yxzl.dev/python-logo-only.svg
|
||||||
|
url: https://python.yxzl.dev/
|
||||||
|
repo: https://github.com/yxzlwz/python-doc-web
|
||||||
|
preview: https://python.yxzl.dev/screenshot.png
|
||||||
|
-
|
||||||
|
name: TinyPiXOS
|
||||||
|
desc: A domestically developed, lightweight, and highly customizable embedded mobile device desktop OS!
|
||||||
|
logo: https://file.tinypixos.com/tinypixos/tplogo.svg
|
||||||
|
url: https://www.tinypixos.com/
|
||||||
|
repo: https://github.com/TinyPiXOS/TinyPiXOS
|
||||||
|
preview: https://file.tinypixos.com/tinypixos/plume_theme_case.jpg
|
||||||
|
-
|
||||||
|
name: HEUOpenResource
|
||||||
|
desc: Harbin Engineering University Resource Sharing Program
|
||||||
|
logo: https://cdn.jsdelivr.net/gh/HEUOpenResource/HEUOpenResource.github.io@main/docs/.vuepress/public/avatar.jpg
|
||||||
|
url: https://heu.us.kg/
|
||||||
|
repo: https://github.com/HEUOpenResource/HEUOpenResource.github.io
|
||||||
|
preview: https://cdn.jsdelivr.net/gh/HEUOpenResource/HEUOpenResource.github.io@main/docs/.vuepress/public/intro.png
|
||||||
|
-
|
||||||
|
name: SKYCRAFT Server Docs
|
||||||
|
desc: Documentation for Minecraft server SKYCRAFT.
|
||||||
|
logo: https://official.skycraft.cn/i/3.jpg
|
||||||
|
url: https://docs.skycraft.cn/
|
||||||
|
preview: https://bbsimage.skycraft.cn/docs-preview.jpg
|
||||||
|
|
||||||
|
blog:
|
||||||
|
-
|
||||||
|
name: Peng Zhanbo
|
||||||
|
desc: Even if slow, keep going; even if you fall behind, even if you fail, you must be able to reach your goal.
|
||||||
|
logo: https://pengzhanbo.cn/images/blogger-fav.png
|
||||||
|
url: https://pengzhanbo.cn/
|
||||||
|
repo: https://github.com/pengzhanbo/pengzhanbo.cn
|
||||||
|
preview: /images/demos/pengzhanbo.webp
|
||||||
|
-
|
||||||
|
name: Er Mao Zi
|
||||||
|
desc: An honest Er Mao Zi, never talks nonsense
|
||||||
|
logo: https://www.ermao.net/images/logo.svg
|
||||||
|
url: https://www.ermao.net/
|
||||||
|
repo: https://github.com/ermaozi
|
||||||
|
preview: /images/demos/ermao.net.png
|
||||||
|
-
|
||||||
|
name: Keep It Simple
|
||||||
|
desc: Entities should not be multiplied beyond necessity
|
||||||
|
logo: https://www.dingyuqi.com/icon/icon.ico
|
||||||
|
url: https://dingyuqi.com
|
||||||
|
repo: https://github.com/dingyuqi
|
||||||
|
preview: https://www.dingyuqi.com/back-ground/site-home-page.png
|
||||||
|
-
|
||||||
|
name: Tu Yongtao
|
||||||
|
desc: The farther you go in your mind, the more stable you walk in reality!
|
||||||
|
logo: http://tuyongtao.top/fettjob/imgs/head.jpg
|
||||||
|
url: http://tuyongtao.top/fettjob/
|
||||||
|
repo: https://github.com/tuyongtao-T
|
||||||
|
preview: /images/demos/tuyongtao.top.jpeg
|
||||||
|
-
|
||||||
|
name: Hoey
|
||||||
|
desc: Teacher, I really want to improve.
|
||||||
|
logo: https://zhenghaoyang.cn/avatar.jpg
|
||||||
|
url: https://zhenghaoyang.cn/
|
||||||
|
repo: https://github.com/zhenghaoyang24
|
||||||
|
preview: https://zhenghaoyang.cn/siteshot.png
|
||||||
|
-
|
||||||
|
name: IXYZ
|
||||||
|
desc: Hi, there
|
||||||
|
logo: https://ixyz.org/favicon.ico
|
||||||
|
url: https://ixyz.org
|
||||||
|
repo: https://github.com/ixyzorg
|
||||||
|
preview: /images/demos/ixyz.org.jpg
|
||||||
|
-
|
||||||
|
name: AJohn
|
||||||
|
desc: Never, ever, ever give up
|
||||||
|
logo: https://cdn.jsdelivr.net/gh/zzyAJohn/Image/blog-favicon.png
|
||||||
|
url: https://ajohn.top/
|
||||||
|
repo: https://github.com/zzyAJohn
|
||||||
|
preview: https://cdn.jsdelivr.net/gh/zzyAJohn/Image/blog-preview.png
|
||||||
|
-
|
||||||
|
name: Jiawei Wang
|
||||||
|
desc: PLUS & WAVE!
|
||||||
|
logo: https://plus-wave.github.io/icon/wave+.png
|
||||||
|
url: https://plus-wave.github.io
|
||||||
|
repo: https://github.com/PLUS-WAVE
|
||||||
|
preview: https://raw.githubusercontent.com/PLUS-WAVE/blog-image/master/img/blog/2024-11-24/plus-wave.github.io.jpg
|
||||||
|
-
|
||||||
|
name: Xiao Mu Mu Ya
|
||||||
|
desc: Life is like chess, once you make a move, you can't take it back; the way of life lies in being calm
|
||||||
|
logo: https://blog.mu00.cn/logo.png
|
||||||
|
url: https://blog.mu00.cn/
|
||||||
|
repo: https://github.com/sunnyboy-mu/sunnyboy-blog
|
||||||
|
preview: /images/demos/sunnyboy_mu.jpg
|
||||||
|
-
|
||||||
|
name: QiHuang02's Notebook
|
||||||
|
desc: Experience is the best teacher.
|
||||||
|
logo: https://qihuang02.cn/favicon.svg
|
||||||
|
url: https://qihuang02.cn/
|
||||||
|
repo: https://github.com/QiHuang02/qihuang02.github.io
|
||||||
|
preview: https://image.qihuang02.cn/file/1736003534894_yulantu.png
|
||||||
|
-
|
||||||
|
name: jiahao
|
||||||
|
desc: Just pursue it, even if it's just a momentary light
|
||||||
|
logo: https://s.jhdev.cn/head.png
|
||||||
|
url: https://jhdev.cn/
|
||||||
|
repo: https://github.com/oh-yey
|
||||||
|
preview: https://s.jhdev.cn/demos/blog-preview.png
|
||||||
|
-
|
||||||
|
name: A Zhe
|
||||||
|
desc: Strengthening yourself is the only way to solve problems
|
||||||
|
logo: https://www.azhe.xin/blogger.png
|
||||||
|
url: https://www.azhe.xin/
|
||||||
|
repo: https://github.com/liuzhemax/blog
|
||||||
|
preview: /images/demos/azhe.jpg
|
||||||
|
-
|
||||||
|
name: jindongjie
|
||||||
|
desc: Keep.It.Simple.Stupid
|
||||||
|
logo: https://ar0m.com/logo/aptrue-sience-logo.png
|
||||||
|
url: https://ar0m.com
|
||||||
|
repo: https://github.com/jindongjie/blog-vuepress-2025
|
||||||
|
preview: /images/demos/jindongjie.jpg
|
||||||
|
-
|
||||||
|
name: Yi Shu Lun
|
||||||
|
desc: A programmer's blog who loves art
|
||||||
|
logo: https://yishulun.com/avatar.png
|
||||||
|
url: https://yishulun.com
|
||||||
|
repo: https://github.com/rixingyike/rixingyike.github.io
|
||||||
|
preview: /images/demos/yishulun.com.jpg
|
||||||
|
-
|
||||||
|
name: Phys Nya
|
||||||
|
desc: Notes and life of a physics student
|
||||||
|
logo: https://physnya.top/images/Physics_nya.jpg
|
||||||
|
url: https://physnya.top
|
||||||
|
repo: https://github.com/physnya/blog
|
||||||
|
preview: https://physnya.top/images/preview.png
|
||||||
|
-
|
||||||
|
name: XINGJI
|
||||||
|
desc: All life so far has been written with failure, but that doesn't stop me from moving forward✨
|
||||||
|
logo: https://i.p-i.vip/47/20240920-66ed7b168c38c.jpg
|
||||||
|
url: https://vue.xingji.fun
|
||||||
|
repo: https://github.com/XingJi-love/XingJi-blog-plume
|
||||||
|
preview: https://i.p-i.vip/47/20250407-67f3f1eca1983.png
|
||||||
|
-
|
||||||
|
name: Paiad
|
||||||
|
desc: Pessimists are always right, optimists always move forward.
|
||||||
|
logo: https://blog.paiad.top/sunflower.png
|
||||||
|
url: https://blog.paiad.top
|
||||||
|
repo: https://github.com/paiad
|
||||||
|
preview: https://blog.paiad.top/paiad-blog.png
|
||||||
|
-
|
||||||
|
name: Flash
|
||||||
|
desc: The road ahead is long; I shall search up and down
|
||||||
|
logo: https://haipeng-lin.cn/images/avatar.jpg
|
||||||
|
url: https://haipeng-lin.cn
|
||||||
|
repo: https://gitee.com/linhaipengg
|
||||||
|
preview: https://img.haipeng-lin.cn/1768622018580.png
|
||||||
|
-
|
||||||
|
name: PinkDopeyBug
|
||||||
|
desc: Mountains are hard to see floating rafts, hearts easily fall into mirror flowers.
|
||||||
|
logo: https://w20241204.dpdns.org/images/avatar.jpg
|
||||||
|
url: https://w20241204.dpdns.org/
|
||||||
|
repo: https://github.com/PinkDopeyBug/blog
|
||||||
|
preview: https://w20241204.dpdns.org/images/demos/preview.png
|
||||||
|
-
|
||||||
|
name: rand777
|
||||||
|
desc: Even wobbly, you can reach your destination.
|
||||||
|
logo: https://blog.rand777.space/avatar.jpg
|
||||||
|
url: https://blog.rand777.space
|
||||||
|
repo: https://github.com/rand777gg/rand777-plume-blog
|
||||||
|
preview: https://blog.rand777.space/siteshot.png
|
||||||
|
-
|
||||||
|
name: Yi Xiang Zhi Lu
|
||||||
|
desc: Yi Xiang Zhi Lu's Blog
|
||||||
|
logo: https://yxzl.dev/head.png
|
||||||
|
url: https://yxzl.dev/
|
||||||
|
repo: https://github.com/yxzlwz/blog
|
||||||
|
preview: https://yxzl.dev/screenshot.png
|
||||||
|
-
|
||||||
|
name: Honahec
|
||||||
|
desc: Honahec's Blog
|
||||||
|
logo: https://image.honahec.cc/avatar-circle.png
|
||||||
|
url: https://blog.honahec.cc/
|
||||||
|
repo: https://github.com/Honahec/blog
|
||||||
|
preview: https://image.honahec.cc/20251018223321710.png
|
||||||
|
-
|
||||||
|
name: Lucas
|
||||||
|
desc: Ad astra abyssosque.
|
||||||
|
logo: https://static.lucas04.top/static/favicon/favicon-64.png
|
||||||
|
url: https://blog.lucas04.top/
|
||||||
|
repo: https://github.com/lucas0-nhr/lucas04-nhr.github.io
|
||||||
|
preview: https://static.lucas04.top/static/blog_preview.png
|
||||||
|
-
|
||||||
|
name: Kairui's Website
|
||||||
|
desc: Mathematics is the art of expressing ideas precisely.
|
||||||
|
logo: https://kairui.ca/uoft.svg
|
||||||
|
url: https://kairui.ca
|
||||||
|
repo: https://github.com/orderization
|
||||||
|
preview: https://kairui.ca/img/homepage_demo.png
|
||||||
|
-
|
||||||
|
name: Konata's Secret Base
|
||||||
|
desc: A private space to record technology and life
|
||||||
|
logo: https://raw.githubusercontent.com/Konata9/pic-base/main/pics/20260126223726455.png
|
||||||
|
url: https://konata9.cc/
|
||||||
|
preview: https://raw.githubusercontent.com/Konata9/pic-base/main/pics/20260125225910673.webp
|
||||||
|
---
|
||||||
|
|
||||||
|
:::important
|
||||||
|
You can always add your documentation or blog to this page via ==PR==.
|
||||||
|
|
||||||
|
Site preview images should be placed in the `docs/.vuepress/public/images/demos` directory. Using remote links is recommended so you can update them at any time.
|
||||||
|
|
||||||
|
Please try to use `.jpg` format for images, and use [tinypng](https://tinypng.com/) for compression if the file size is large.
|
||||||
|
:::
|
||||||
|
|
||||||
|
[Go to **Github Pull Request** to submit your site](https://github.com/pengzhanbo/vuepress-theme-plume/edit/main/docs/en/demos.md){.read-more}
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
<Demos :list="$frontmatter.docs" />
|
||||||
|
|
||||||
|
## Blog
|
||||||
|
|
||||||
|
<Demos :list="$frontmatter.blog" />
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import Demos from '~/components/Demos.vue'
|
||||||
|
</script>
|
||||||
@ -77,12 +77,12 @@ list:
|
|||||||
name: pengzhanbo
|
name: pengzhanbo
|
||||||
link: https://github.com/pengzhanbo
|
link: https://github.com/pengzhanbo
|
||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
-
|
-
|
||||||
name: pengzhanbo
|
name: pengzhanbo
|
||||||
link: https://github.com/pengzhanbo
|
link: https://github.com/pengzhanbo
|
||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
socials:
|
socials:
|
||||||
-
|
-
|
||||||
icon: github
|
icon: github
|
||||||
@ -96,7 +96,7 @@ list:
|
|||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
location: GuangZhou
|
location: GuangZhou
|
||||||
organization: PengZhanBo
|
organization: PengZhanBo
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
socials:
|
socials:
|
||||||
-
|
-
|
||||||
icon: github
|
icon: github
|
||||||
@ -110,17 +110,17 @@ list:
|
|||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
location: GuangZhou
|
location: GuangZhou
|
||||||
organization: PengZhanBo
|
organization: PengZhanBo
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
groups:
|
groups:
|
||||||
-
|
-
|
||||||
title: 分组 1
|
title: Group 1
|
||||||
desc: 自定义颜色
|
desc: Custom colors
|
||||||
list:
|
list:
|
||||||
-
|
-
|
||||||
name: pengzhanbo
|
name: pengzhanbo
|
||||||
link: https://github.com/pengzhanbo
|
link: https://github.com/pengzhanbo
|
||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
backgroundColor: rgb(255,153,0)
|
backgroundColor: rgb(255,153,0)
|
||||||
color: rgb(255,255,153)
|
color: rgb(255,255,153)
|
||||||
nameColor: rgb(255,255,170)
|
nameColor: rgb(255,255,170)
|
||||||
@ -135,7 +135,7 @@ groups:
|
|||||||
name: pengzhanbo
|
name: pengzhanbo
|
||||||
link: https://github.com/pengzhanbo
|
link: https://github.com/pengzhanbo
|
||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
backgroundColor: rgb(255,102,102)
|
backgroundColor: rgb(255,102,102)
|
||||||
color: rgb(255,204,204)
|
color: rgb(255,204,204)
|
||||||
nameColor: rgb(255,238,238)
|
nameColor: rgb(255,238,238)
|
||||||
@ -143,22 +143,22 @@ groups:
|
|||||||
name: pengzhanbo
|
name: pengzhanbo
|
||||||
link: https://github.com/pengzhanbo
|
link: https://github.com/pengzhanbo
|
||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
backgroundColor: rgb(0,153,204)
|
backgroundColor: rgb(0,153,204)
|
||||||
color: rgb(153,238,255)
|
color: rgb(153,238,255)
|
||||||
nameColor: rgb(153,255,255)
|
nameColor: rgb(153,255,255)
|
||||||
-
|
-
|
||||||
title: 分组 2
|
title: Group 2
|
||||||
desc: 这里是分组 2 的描述文字
|
desc: Description for Group 2
|
||||||
list:
|
list:
|
||||||
-
|
-
|
||||||
name: pengzhanbo
|
name: pengzhanbo
|
||||||
link: https://github.com/pengzhanbo
|
link: https://github.com/pengzhanbo
|
||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
-
|
-
|
||||||
name: pengzhanbo
|
name: pengzhanbo
|
||||||
link: https://github.com/pengzhanbo
|
link: https://github.com/pengzhanbo
|
||||||
avatar: https://github.com/pengzhanbo.png
|
avatar: https://github.com/pengzhanbo.png
|
||||||
desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。
|
desc: Even if slow, persist without stop; even if falling behind, even if failing, one must be able to reach the goal they are heading towards.
|
||||||
---
|
---
|
||||||
|
|||||||
@ -86,7 +86,7 @@ Refer to the [ECharts documentation](https://echarts.apache.org/handbook/zh/get-
|
|||||||
## Advanced
|
## Advanced
|
||||||
|
|
||||||
You can import and use `defineEchartsConfig` in the
|
You can import and use `defineEchartsConfig` in the
|
||||||
[client configuration file](https://vuejs.press/zh/guide/configuration.html##使用脚本) to customize ECharts:
|
[client configuration file](https://vuejs.press/guide/configuration.html#client-config-file) to customize ECharts:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { defineEchartsConfig } from '@vuepress/plugin-markdown-chart/client'
|
import { defineEchartsConfig } from '@vuepress/plugin-markdown-chart/client'
|
||||||
|
|||||||
@ -346,6 +346,6 @@ Symbols that should probably not be used in text: `=>`, `->`, `:>`, `|`, `@>`, a
|
|||||||
|
|
||||||
To emphasize a specific path in the flowchart, you can additionally define it as follows:
|
To emphasize a specific path in the flowchart, you can additionally define it as follows:
|
||||||
|
|
||||||
```
|
```md
|
||||||
st@>op1({"stroke":"Red"})@>cond({"stroke":"Red","stroke-width":6,"arrow-end":"classic-wide-long"})@>c2({"stroke":"Red"})@>op2({"stroke":"Red"})@>e({"stroke":"Red"})
|
st@>op1({"stroke":"Red"})@>cond({"stroke":"Red","stroke-width":6,"arrow-end":"classic-wide-long"})@>c2({"stroke":"Red"})@>op2({"stroke":"Red"})@>e({"stroke":"Red"})
|
||||||
```
|
```
|
||||||
|
|||||||
@ -260,7 +260,7 @@ object NewYork
|
|||||||
|
|
||||||
map CapitalCity {
|
map CapitalCity {
|
||||||
UK *-> London
|
UK *-> London
|
||||||
USA *--> Washington
|
USA*--> Washington
|
||||||
Germany *---> Berlin
|
Germany *---> Berlin
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,9 +427,9 @@ rectangle "Investigate" as I <<$bProcess>><<behavior>> #Business
|
|||||||
rectangle "Pay" as P <<$bProcess>><<behavior>> #Business
|
rectangle "Pay" as P <<$bProcess>><<behavior>> #Business
|
||||||
|
|
||||||
HC *-down- CI
|
HC *-down- CI
|
||||||
HC *-down- NAS
|
HC*-down- NAS
|
||||||
HC *-down- V
|
HC *-down- V
|
||||||
HC *-down- I
|
HC*-down- I
|
||||||
HC *-down- P
|
HC *-down- P
|
||||||
|
|
||||||
CI -right->> NAS
|
CI -right->> NAS
|
||||||
@ -574,16 +574,16 @@ caption figure 1
|
|||||||
title My super title
|
title My super title
|
||||||
|
|
||||||
* <&flag>Debian
|
* <&flag>Debian
|
||||||
** <&globe>Ubuntu
|
**<&globe>Ubuntu
|
||||||
*** Linux Mint
|
***Linux Mint
|
||||||
*** Kubuntu
|
*** Kubuntu
|
||||||
*** Lubuntu
|
***Lubuntu
|
||||||
*** KDE Neon
|
*** KDE Neon
|
||||||
** <&graph>LMDE
|
** <&graph>LMDE
|
||||||
** <&pulse>SolydXK
|
**<&pulse>SolydXK
|
||||||
** <&people>SteamOS
|
** <&people>SteamOS
|
||||||
** <&star>Raspbian with a very long name
|
** <&star>Raspbian with a very long name
|
||||||
*** <s>Raspmbc</s> => OSMC
|
***<s>Raspmbc</s> => OSMC
|
||||||
*** <s>Raspyfi</s> => Volumio
|
*** <s>Raspyfi</s> => Volumio
|
||||||
|
|
||||||
header
|
header
|
||||||
@ -630,9 +630,9 @@ endlegend
|
|||||||
|
|
||||||
```md
|
```md
|
||||||
@startjson
|
@startjson
|
||||||
#highlight "lastName"
|
# highlight "lastName"
|
||||||
#highlight "address" / "city"
|
# highlight "address" / "city"
|
||||||
#highlight "phoneNumbers" / "0" / "number"
|
# highlight "phoneNumbers" / "0" / "number"
|
||||||
{
|
{
|
||||||
"firstName": "John",
|
"firstName": "John",
|
||||||
"lastName": "Smith",
|
"lastName": "Smith",
|
||||||
|
|||||||
@ -49,7 +49,7 @@ for example `:line-numbers=2` indicates that line numbers in the code block star
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```ts:line-numbers
|
```ts:line-numbers
|
||||||
// Line numbers enabled
|
// Line numbers enabled
|
||||||
const line2 = 'This is line 2'
|
const line2 = 'This is line 2'
|
||||||
@ -95,7 +95,7 @@ Add `{xxxx}` immediately after `[lang]` to enable line highlighting, where `xxx`
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js{4}
|
```js{4}
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
@ -127,7 +127,7 @@ In addition to single lines, you can specify multiple single lines, line ranges,
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js{1,4,6-8}
|
```js{1,4,6-8}
|
||||||
export default { // Highlighted
|
export default { // Highlighted
|
||||||
data () {
|
data () {
|
||||||
@ -163,10 +163,10 @@ You can also use the `// [!code highlight]` comment to enable line highlighting.
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
msg: 'Highlighted!' // [\!code highlight]
|
msg: 'Highlighted!' // [\!code highlight]
|
||||||
}
|
}
|
||||||
@ -195,10 +195,10 @@ Additionally, you can use `// [!code focus:<lines>]` to define the number of lin
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
msg: 'Focused!' // [\!code focus]
|
msg: 'Focused!' // [\!code focus]
|
||||||
}
|
}
|
||||||
@ -242,10 +242,10 @@ Adding `// [!code --]` or `// [!code ++]` comments to a line will create a diff
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
error: 'Removed', // [\!code --]
|
error: 'Removed', // [\!code --]
|
||||||
warning: 'Added' // [\!code ++]
|
warning: 'Added' // [\!code ++]
|
||||||
@ -289,10 +289,10 @@ Adding `// [!code warning]` or `// [!code error]` comments to a line will apply
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
error: 'Error', // [\!code error]
|
error: 'Error', // [\!code error]
|
||||||
warning: 'Warning' // [\!code warning]
|
warning: 'Warning' // [\!code warning]
|
||||||
@ -334,7 +334,7 @@ mkdir hello && cd hello # [!code warning]
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```ts
|
```ts
|
||||||
export function foo() { // [\!code word:Hello]
|
export function foo() { // [\!code word:Hello]
|
||||||
const msg = 'Hello World'
|
const msg = 'Hello World'
|
||||||
@ -357,7 +357,7 @@ will highlight only the first two occurrences of `options`.
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```ts
|
```ts
|
||||||
// [\!code word:options:2]
|
// [\!code word:options:2]
|
||||||
const options = { foo: 'bar' }
|
const options = { foo: 'bar' }
|
||||||
|
|||||||
@ -61,7 +61,7 @@ In Markdown, the `::: card-masonry` container can be used instead of `<CardMason
|
|||||||
``` md
|
``` md
|
||||||
::: card-masonry cols="3" gap="16" <!-- [!code hl]-->
|
::: card-masonry cols="3" gap="16" <!-- [!code hl]-->
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<!-- More content -->
|
<!-- More content -->
|
||||||
|
|
||||||
@ -79,17 +79,17 @@ Masonry layout is particularly suitable for displaying images. You can directly
|
|||||||
``` md
|
``` md
|
||||||
::: card-masonry
|
::: card-masonry
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
:::
|
:::
|
||||||
```
|
```
|
||||||
|
|||||||
@ -132,4 +132,4 @@ It can also be placed within a `<CardGrid>` component.
|
|||||||
/>
|
/>
|
||||||
</CardGrid>
|
</CardGrid>
|
||||||
|
|
||||||
[View Photography Works Example](../../../../../blog/1.示例/照片类作品示例.md)
|
[View Photography Works Example](/en/demos/)
|
||||||
|
|||||||
@ -129,8 +129,7 @@ config:
|
|||||||
|
|
||||||
**Result:**
|
**Result:**
|
||||||
|
|
||||||
:::demo-wrapper img no-padding
|
::: window
|
||||||
|
|
||||||

|

|
||||||
:::
|
:::
|
||||||
|
|
||||||
@ -246,7 +245,7 @@ config:
|
|||||||
|
|
||||||
**Result:**
|
**Result:**
|
||||||
|
|
||||||
:::demo-wrapper img no-padding
|
::: window
|
||||||
<img src="/images/custom-doc-hero.jpg" alt="Theme Plume" />
|
<img src="/images/custom-doc-hero.jpg" alt="Theme Plume" />
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@ -359,7 +358,7 @@ config:
|
|||||||
|
|
||||||
**Result:**
|
**Result:**
|
||||||
|
|
||||||
:::demo-wrapper img no-padding
|
:::window
|
||||||
<img src="/images/custom-features.jpg" alt="custom-features" />
|
<img src="/images/custom-features.jpg" alt="custom-features" />
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@ -432,11 +431,11 @@ config:
|
|||||||
|
|
||||||
**Result:**
|
**Result:**
|
||||||
|
|
||||||
:::demo-wrapper img no-padding
|
:::window
|
||||||
<img src="/images/custom-image-text.jpg" alt="image-text" />
|
<img src="/images/custom-image-text.jpg" alt="image-text" />
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::demo-wrapper img no-padding
|
:::window
|
||||||
<img src="/images/custom-text-image.jpg" alt="text-image" />
|
<img src="/images/custom-text-image.jpg" alt="text-image" />
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@ -505,7 +504,7 @@ config:
|
|||||||
|
|
||||||
**Result:**
|
**Result:**
|
||||||
|
|
||||||
:::demo-wrapper img no-padding
|
:::window
|
||||||
<img src="/images/custom-profile.jpg" alt="profile" />
|
<img src="/images/custom-profile.jpg" alt="profile" />
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@ -551,7 +550,7 @@ yarn add vuepress@next vuepress-theme-plume
|
|||||||
|
|
||||||
**Result:**
|
**Result:**
|
||||||
|
|
||||||
:::demo-wrapper img no-padding
|
:::window
|
||||||
<img src="/images/custom-content.jpg" alt="content" />
|
<img src="/images/custom-content.jpg" alt="content" />
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ export default defineUserConfig({
|
|||||||
encrypt: {
|
encrypt: {
|
||||||
rules: {
|
rules: {
|
||||||
// Can be the relative path of an MD file to encrypt that file
|
// Can be the relative path of an MD file to encrypt that file
|
||||||
'前端/基础.md': '123456',
|
'frontend/basics.md': '123456',
|
||||||
// Can be a directory path to encrypt all articles under that directory
|
// Can be a directory path to encrypt all articles under that directory
|
||||||
'/notes/vuepress-theme-plume/': '123456',
|
'/notes/vuepress-theme-plume/': '123456',
|
||||||
// Can be a request path to encrypt all articles under that path
|
// Can be a request path to encrypt all articles under that path
|
||||||
@ -115,6 +115,109 @@ passwordHint: The password is 123456
|
|||||||
|
|
||||||
Click to visit [Encrypted Article, Password: 123456](/article/enx7c9s/)
|
Click to visit [Encrypted Article, Password: 123456](/article/enx7c9s/)
|
||||||
|
|
||||||
|
## Partial Content Encryption
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
Partial content encryption is implemented through the `::: encrypt` container. You need to configure the `markdown.encrypt` option:
|
||||||
|
|
||||||
|
```ts title=".vuepress/config.ts"
|
||||||
|
export default defineUserConfig({
|
||||||
|
theme: plumeTheme({
|
||||||
|
markdown: {
|
||||||
|
encrypt: true, // [!code ++]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also set a unified default password for the `::: encrypt` container:
|
||||||
|
|
||||||
|
```ts title=".vuepress/config.ts"
|
||||||
|
export default defineUserConfig({
|
||||||
|
theme: plumeTheme({
|
||||||
|
markdown: {
|
||||||
|
encrypt: {
|
||||||
|
password: 123456, // [!code ++]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
Use the `::: encrypt` container to wrap the content that needs to be encrypted.
|
||||||
|
You can add `password` / `pwd` attribute to the container to set the password for that container.
|
||||||
|
If no password is set, the default password will be used.
|
||||||
|
|
||||||
|
You can also add a `hint` attribute to set a password hint.
|
||||||
|
|
||||||
|
```md /password="123456"/
|
||||||
|
::: encrypt password="123456" hint="The password is 6 consecutive digits"
|
||||||
|
This is encrypted content
|
||||||
|
:::
|
||||||
|
```
|
||||||
|
|
||||||
|
::: info Only one password is effective; multiple passwords are not supported simultaneously.
|
||||||
|
:::
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
**Input:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
::: encrypt password="123456"
|
||||||
|
This is encrypted content
|
||||||
|
:::
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
::: encrypt password="123456"
|
||||||
|
This is encrypted content
|
||||||
|
:::
|
||||||
|
|
||||||
|
**Input:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
::: encrypt password="654321" hint="The password is 6 consecutive digits"
|
||||||
|
This is encrypted content 2
|
||||||
|
:::
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
::: encrypt password="654321" hint="The password is 6 consecutive digits"
|
||||||
|
This is encrypted content 2
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: warning Usage Limitations
|
||||||
|
**For encrypted content, you can use:**
|
||||||
|
|
||||||
|
- All standard markdown syntax
|
||||||
|
- Most extended syntax provided by the theme, except:
|
||||||
|
- `@[demo]()` code examples imported from directories
|
||||||
|
- `@[code]()` code snippets imported from directories
|
||||||
|
- `@[code-tree]()` code trees imported from directories
|
||||||
|
- Global Vue components provided by the theme
|
||||||
|
- User-defined global Vue components
|
||||||
|
- Encrypted content cannot contain executable scripts; for special interactions, please implement through components.
|
||||||
|
|
||||||
|
**Network Environment Requirements:**
|
||||||
|
Partial content encryption is implemented using [Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Crypto),
|
||||||
|
therefore, it will not work properly in **non-HTTPS environments**.
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: details If you are a technical developer, you may need to know
|
||||||
|
|
||||||
|
The original markdown content is first rendered into HTML content, then encrypted; transmitted to the client, then decrypted and rendered.
|
||||||
|
The decrypted content is wrapped as a dynamic Vue component, with HTML passed as the template to the dynamic component.
|
||||||
|
This involves runtime template compilation. As a result, if partial content encryption is enabled,
|
||||||
|
Vue needs to be switched to the `esm-bundler` version to support runtime compilation,
|
||||||
|
which has slightly worse performance and larger size compared to the default `runtime-only` version.
|
||||||
|
:::
|
||||||
|
|
||||||
## Related Configurations
|
## Related Configurations
|
||||||
|
|
||||||
The following configurations can be used in [multilingual settings](../../config/locales.md).
|
The following configurations can be used in [multilingual settings](../../config/locales.md).
|
||||||
|
|||||||
@ -16,7 +16,7 @@ The theme supports icons from the following sources:
|
|||||||
Icons are used in the same way across the following theme features:
|
Icons are used in the same way across the following theme features:
|
||||||
|
|
||||||
- [Navbar Icons](../../config/navbar.md#configuration)
|
- [Navbar Icons](../../config/navbar.md#configuration)
|
||||||
- [Sidebar Icons](../../guide/document.md#sidebar-icons)
|
- [Sidebar Icons](../../guide/quick-start/sidebar.md#visual-enhancement-features)
|
||||||
- [File Tree Icons](../../guide/markdown/file-tree.md)
|
- [File Tree Icons](../../guide/markdown/file-tree.md)
|
||||||
- [Code Group Title Icons](../code/code-tabs.md#group-title-icons)
|
- [Code Group Title Icons](../code/code-tabs.md#group-title-icons)
|
||||||
|
|
||||||
|
|||||||
@ -36,11 +36,11 @@ For more configuration options, please refer to [@vuepress/plugin-photo-swipe](h
|
|||||||
Image preview can be disabled by using the `no-view` or `ignore` class names, or the `no-view` attribute.
|
Image preview can be disabled by using the `no-view` or `ignore` class names, or the `no-view` attribute.
|
||||||
|
|
||||||
```md
|
```md
|
||||||
{.no-view}
|
{.no-view}
|
||||||
{.ignore}
|
{.ignore}
|
||||||
{no-view}
|
{no-view}
|
||||||
|
|
||||||
<img src="path/to/image" class="no-view">
|
<img src="path/to/image" class="no-view" alt="alt text">
|
||||||
<img src="path/to/image" class="ignore">
|
<img src="path/to/image" class="ignore" alt="alt text">
|
||||||
<img src="path/to/image" no-view>
|
<img src="path/to/image" no-view alt="alt text">
|
||||||
```
|
```
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
title: LLMs txt
|
title: LLMs txt
|
||||||
icon: ri:ai
|
icon: ri:ai
|
||||||
createTime: 2025/12/01 10:46:46
|
createTime: 2025/12/01 10:46:46
|
||||||
permalink: /en/features/llmstxt/
|
permalink: /en/guide/features/llmstxt/
|
||||||
---
|
---
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|||||||
@ -90,7 +90,7 @@ In markdown, use local asset paths directly:
|
|||||||
```md
|
```md
|
||||||

|

|
||||||
|
|
||||||
<img src="/images/foo.jpg">
|
<img src="/images/foo.jpg" alt="foo">
|
||||||
```
|
```
|
||||||
|
|
||||||
In `javascript`:
|
In `javascript`:
|
||||||
|
|||||||
@ -96,5 +96,5 @@ This is the card content.
|
|||||||
::::
|
::::
|
||||||
|
|
||||||
::: info
|
::: info
|
||||||
If you prefer using cards via components, you can check out the [Card Component](/guide/features/component/#card).
|
If you prefer using cards via components, you can check out the [Card Component](../features/component.md#card).
|
||||||
:::
|
:::
|
||||||
|
|||||||
@ -36,7 +36,7 @@ Bad news: I've used you as the example \[doge\]
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
In Markdown, wrapping specially formatted text content within a `:: chat` container allows you to display ==chat records== within the documentation.
|
In Markdown, wrapping specially formatted text content within a `::: chat` container allows you to display ==chat records== within the documentation.
|
||||||
|
|
||||||
::: warning This is a feature you likely won't need most of the time.
|
::: warning This is a feature you likely won't need most of the time.
|
||||||
Please consider carefully whether you should use it when the need arises.
|
Please consider carefully whether you should use it when the need arises.
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: container
|
title: Tip Containers
|
||||||
icon: mdi:message-text-outline
|
icon: mdi:message-text-outline
|
||||||
createTime: 2025/11/29 14:53:21
|
createTime: 2025/11/29 14:53:21
|
||||||
permalink: /en/guide/markdown/container/
|
permalink: /en/guide/markdown/container/
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: Demo Container
|
title: Demo Container
|
||||||
createTime: 2025/10/08 14:47:12
|
createTime: 2025/10/08 14:47:12
|
||||||
icon: icon-park-outline:eyes
|
icon: fxemoji:window
|
||||||
permalink: /en/guide/markdown/demo-wrapper/
|
permalink: /en/guide/markdown/window/
|
||||||
outline: 2
|
outline: 2
|
||||||
|
badge:
|
||||||
|
text: Change
|
||||||
|
type: warning
|
||||||
---
|
---
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
@ -14,7 +17,7 @@ separately from other content. The theme supports adding demo containers in Mark
|
|||||||
## Syntax
|
## Syntax
|
||||||
|
|
||||||
````md
|
````md
|
||||||
::: demo-wrapper
|
::: window
|
||||||
Add your demo here
|
Add your demo here
|
||||||
:::
|
:::
|
||||||
````
|
````
|
||||||
@ -31,20 +34,20 @@ Add your demo here
|
|||||||
Containing only images:
|
Containing only images:
|
||||||
|
|
||||||
```md
|
```md
|
||||||
::: demo-wrapper img no-padding
|
::: window
|
||||||

|

|
||||||
:::
|
:::
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
::: demo-wrapper img no-padding
|
::: window
|
||||||

|

|
||||||
:::
|
:::
|
||||||
|
|
||||||
Containing markdown syntax:
|
Containing markdown syntax:
|
||||||
|
|
||||||
```md
|
```md
|
||||||
::: demo-wrapper title="Title"
|
::: window title="Title"
|
||||||
### Level 3 Heading
|
### Level 3 Heading
|
||||||
|
|
||||||
This is content inside the demo container.
|
This is content inside the demo container.
|
||||||
@ -52,7 +55,7 @@ This is content inside the demo container.
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
::: demo-wrapper title="Title"
|
::: window title="Title"
|
||||||
|
|
||||||
### Level 3 Heading
|
### Level 3 Heading
|
||||||
|
|
||||||
@ -62,7 +65,7 @@ This is content inside the demo container.
|
|||||||
Containing HTML/Vue code:
|
Containing HTML/Vue code:
|
||||||
|
|
||||||
```md
|
```md
|
||||||
::: demo-wrapper
|
::: window
|
||||||
<h1 class="your-demo-title">This is a heading</h1>
|
<h1 class="your-demo-title">This is a heading</h1>
|
||||||
<p class="your-demo-paragraph">This is a paragraph</p>
|
<p class="your-demo-paragraph">This is a paragraph</p>
|
||||||
|
|
||||||
@ -78,7 +81,7 @@ Containing HTML/Vue code:
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
::: demo-wrapper
|
::: window
|
||||||
|
|
||||||
<h1 class="your-demo-title">This is a heading</h1>
|
<h1 class="your-demo-title">This is a heading</h1>
|
||||||
<p class="your-demo-paragraph">This is a paragraph</p>
|
<p class="your-demo-paragraph">This is a paragraph</p>
|
||||||
|
|||||||
@ -12,9 +12,9 @@ import { people, nature, foods, places, activities, symbols, objects, flags } fr
|
|||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
在 Markdown 中使用表情符号非常简单,只需用冒号包裹表情代码即可:
|
Using emoji in Markdown is very simple, just wrap the emoji code with colons:
|
||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
```md
|
```md
|
||||||
:tada: :100:
|
:tada: :100:
|
||||||
|
|||||||
@ -159,13 +159,13 @@ Right-aligned content
|
|||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````md
|
````md
|
||||||
The farthest distance in the world Is not the distance between life and death But you don't know I love you when I stand in front of you.[^footnote1]。
|
The farthest distance in the world Is not the distance between life and death But you don't know I love you when I stand in front of you.[^footnote1].
|
||||||
|
|
||||||
[^footnote1]: From India.Rabindranath Tagore **The Farthest Distance in the World**
|
[^footnote1]: From India.Rabindranath Tagore **The Farthest Distance in the World**
|
||||||
````
|
````
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
|
|
||||||
The farthest distance in the world Is not the distance between life and death But you don't know I love you when I stand in front of you.[^footnote1]。
|
The farthest distance in the world Is not the distance between life and death But you don't know I love you when I stand in front of you.[^footnote1].
|
||||||
|
|
||||||
[^footnote1]: From India.Rabindranath Tagore **The Farthest Distance in the World**
|
[^footnote1]: From India.Rabindranath Tagore **The Farthest Distance in the World**
|
||||||
|
|||||||
@ -3,6 +3,9 @@ title: File Tree
|
|||||||
createTime: 2025/10/08 14:41:57
|
createTime: 2025/10/08 14:41:57
|
||||||
icon: mdi:file-tree
|
icon: mdi:file-tree
|
||||||
permalink: /en/guide/markdown/file-tree/
|
permalink: /en/guide/markdown/file-tree/
|
||||||
|
badge:
|
||||||
|
text: Change
|
||||||
|
type: warning
|
||||||
---
|
---
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
@ -18,7 +21,7 @@ displayed, simply add a slash `/` at the end of the list item.
|
|||||||
The following syntax can be used to customize the appearance of the file tree:
|
The following syntax can be used to customize the appearance of the file tree:
|
||||||
|
|
||||||
- Emphasize file or directory names by making them bold, e.g., `**README.md**`
|
- Emphasize file or directory names by making them bold, e.g., `**README.md**`
|
||||||
- Add comments to files or directories by adding additional text after the name
|
- Add comments to files or directories by appending a comment starting with `#` after the name, for example, `README.md This is a README file`
|
||||||
- Mark files or directories as **added** or **deleted** by prefixing the name with `++` or `--`
|
- Mark files or directories as **added** or **deleted** by prefixing the name with `++` or `--`
|
||||||
- Use `...` or `…` as the name to add placeholder files and directories.
|
- Use `...` or `…` as the name to add placeholder files and directories.
|
||||||
- Add `icon="simple"` or `icon="colored"` after `:::file-tree` to switch to simple icons or colored icons. The default is colored icons.
|
- Add `icon="simple"` or `icon="colored"` after `:::file-tree` to switch to simple icons or colored icons. The default is colored icons.
|
||||||
@ -34,7 +37,7 @@ The following syntax can be used to customize the appearance of the file tree:
|
|||||||
- ++ config.ts
|
- ++ config.ts
|
||||||
- -- page1.md
|
- -- page1.md
|
||||||
- README.md
|
- README.md
|
||||||
- theme A **theme** directory
|
- theme # A **theme** directory
|
||||||
- client
|
- client
|
||||||
- components
|
- components
|
||||||
- **Navbar.vue**
|
- **Navbar.vue**
|
||||||
@ -61,7 +64,7 @@ The following syntax can be used to customize the appearance of the file tree:
|
|||||||
- ++ config.ts
|
- ++ config.ts
|
||||||
- -- page1.md
|
- -- page1.md
|
||||||
- README.md
|
- README.md
|
||||||
- theme A **theme** directory
|
- theme # A **theme** directory
|
||||||
- client
|
- client
|
||||||
- components
|
- components
|
||||||
- **Navbar.vue**
|
- **Navbar.vue**
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: github-alerts
|
title: GitHub Alerts
|
||||||
createTime: 2025/11/29 21:20:21
|
icon: mdi:alert-outline
|
||||||
|
createTime: 2025/11/29 19:59:45
|
||||||
permalink: /en/guide/markdown/github-alerts/
|
permalink: /en/guide/markdown/github-alerts/
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
title: Icons
|
title: Icons
|
||||||
createTime: 2025/10/08 14:49:39
|
createTime: 2025/10/08 14:49:39
|
||||||
icon: grommet-icons:emoji
|
icon: grommet-icons:emoji
|
||||||
permalink: /en/guide/markdown/icon/
|
permalink: /en/guide/markdown/icons/
|
||||||
---
|
---
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -391,7 +391,7 @@ Output:
|
|||||||
|
|
||||||
[Add more style support for Fontawesome](https://docs.fontawesome.com/web/style/styling){.read-more}
|
[Add more style support for Fontawesome](https://docs.fontawesome.com/web/style/styling){.read-more}
|
||||||
|
|
||||||
```
|
```md
|
||||||
::circle-user 2xl:: <!-- 2xl is shorthand for fa-2xl, icon size is 2em -->
|
::circle-user 2xl:: <!-- 2xl is shorthand for fa-2xl, icon size is 2em -->
|
||||||
::circle-user rotate-90:: <!-- icon rotated 90 degrees -->
|
::circle-user rotate-90:: <!-- icon rotated 90 degrees -->
|
||||||
::circle-user beat:: <!-- icon animation -->
|
::circle-user beat:: <!-- icon animation -->
|
||||||
|
|||||||
@ -144,18 +144,18 @@ Included via `<!-- @include: ./foo.snippet.md#snippet -->`.
|
|||||||
|
|
||||||
Using `<!-- @include: ./foo.snippet.md -->` to include the entire file:
|
Using `<!-- @include: ./foo.snippet.md -->` to include the entire file:
|
||||||
|
|
||||||
:::: demo-wrapper title="Include by file"
|
:::: window title="Include by file"
|
||||||
<!-- @include: ../../snippet/include-2.snippet.md -->
|
<!-- @include: ../../snippet/include-2.snippet.md -->
|
||||||
::::
|
::::
|
||||||
|
|
||||||
Using `<!-- @include: ./foo.snippet.md{5-7} -->` to include lines 5-7 of the file:
|
Using `<!-- @include: ./foo.snippet.md{5-7} -->` to include lines 5-7 of the file:
|
||||||
|
|
||||||
:::: demo-wrapper title="Include by lines"
|
:::: window title="Include by lines"
|
||||||
<!-- @include: ../../snippet/include-2.snippet.md{5-7} -->
|
<!-- @include: ../../snippet/include-2.snippet.md{5-7} -->
|
||||||
::::
|
::::
|
||||||
|
|
||||||
Using `<!-- @include: ./foo.snippet.md#snippet -->` to include the `snippet` region:
|
Using `<!-- @include: ./foo.snippet.md#snippet -->` to include the `snippet` region:
|
||||||
|
|
||||||
:::: demo-wrapper title="Include by file region"
|
:::: window title="Include by file region"
|
||||||
<!-- @include: ../../snippet/include-2.snippet.md#snippet -->
|
<!-- @include: ../../snippet/include-2.snippet.md#snippet -->
|
||||||
::::
|
::::
|
||||||
|
|||||||
337
docs/en/guide/markdown/obsidian.md
Normal file
337
docs/en/guide/markdown/obsidian.md
Normal file
@ -0,0 +1,337 @@
|
|||||||
|
---
|
||||||
|
title: Obsidian Compatibility
|
||||||
|
icon: simple-icons:obsidian
|
||||||
|
createTime: 2026/04/17 21:56:55
|
||||||
|
permalink: /en/guide/markdown/obsidian/
|
||||||
|
---
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
The theme provides compatibility support for Obsidian's official Markdown extension syntax through the `vuepress-plugin-md-power` plugin, enabling Obsidian users to write documentation using familiar syntax.
|
||||||
|
|
||||||
|
Currently supported Obsidian extension syntax includes:
|
||||||
|
|
||||||
|
- [Wiki Links](#wiki-links) - Syntax for inter-page linking
|
||||||
|
- [Embeds](#embeds) - Embed content from other files into the current page
|
||||||
|
- [Comments](#comments) - Add comments visible only during editing
|
||||||
|
|
||||||
|
::: warning No plans to support extension syntax provided by Obsidian's third-party community plugins
|
||||||
|
:::
|
||||||
|
|
||||||
|
## Wiki Links
|
||||||
|
|
||||||
|
Wiki Links are syntax used in Obsidian for linking to other notes. Use double brackets `[[]]` to wrap content to create internal links.
|
||||||
|
|
||||||
|
### Syntax
|
||||||
|
|
||||||
|
```md
|
||||||
|
[[filename]]
|
||||||
|
[[filename#heading]]
|
||||||
|
[[filename#heading#subheading]]
|
||||||
|
[[filename|alias]]
|
||||||
|
[[filename#heading|alias]]
|
||||||
|
[[https://example.com|External Link]]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Filename Search Rules
|
||||||
|
|
||||||
|
When using Wiki Links, filenames are matched according to the following rules:
|
||||||
|
|
||||||
|
**Match Priority:**
|
||||||
|
|
||||||
|
1. **Full Path** - Exact match against file paths
|
||||||
|
2. **Fuzzy Match** - Match filenames at the end of paths, prioritizing the shortest path
|
||||||
|
|
||||||
|
**Path Resolution Rules:**
|
||||||
|
|
||||||
|
- **Relative paths** (starting with `.`): Resolved relative to the current file's directory
|
||||||
|
- **Absolute paths** (not starting with `.`): Searched throughout the document tree, prioritizing the shortest path
|
||||||
|
- **Directory form** (ending with `/`): Matches `README.md` in that directory
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
Assuming the following document structure:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
docs/
|
||||||
|
├── README.md
|
||||||
|
├── guide/
|
||||||
|
│ ├── README.md
|
||||||
|
│ └── markdown/
|
||||||
|
│ └── obsidian.md
|
||||||
|
```
|
||||||
|
|
||||||
|
In `docs/guide/markdown/obsidian.md`:
|
||||||
|
|
||||||
|
| Syntax | Match Result |
|
||||||
|
| ------------------ | ----------------------------------------------------------------------------------------- |
|
||||||
|
| `[[obsidian]]` | Matches `docs/guide/markdown/obsidian.md` (matched via filename) |
|
||||||
|
| `[[./]]` | Matches `docs/guide/markdown/README.md` (relative path) |
|
||||||
|
| `[[../]]` | Matches `docs/guide/README.md` (parent directory) |
|
||||||
|
| `[[guide/]]` | Matches `docs/guide/README.md` (directory form) |
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
**External Links:**
|
||||||
|
|
||||||
|
**Input:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
[[https://example.com|External Link]]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
[[https://example.com|External Link]]
|
||||||
|
|
||||||
|
**Internal Anchor Links:**
|
||||||
|
|
||||||
|
**Input:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
[[npm-to]] <!-- Search by filename -->
|
||||||
|
[[guide/markdown/math]] <!-- Search by file path -->
|
||||||
|
[[#Wiki Links]] <!-- Heading on current page -->
|
||||||
|
[[file-tree#Configuration]] <!-- Search by filename, link to heading -->
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
[[npm-to]]
|
||||||
|
|
||||||
|
[[guide/markdown/math]]
|
||||||
|
|
||||||
|
[[#Wiki Links]]
|
||||||
|
|
||||||
|
[[file-tree#Configuration]]
|
||||||
|
|
||||||
|
[Obsidian Official - **Wiki Links**](https://obsidian.md/en/help/links){.readmore}
|
||||||
|
|
||||||
|
## Embeds
|
||||||
|
|
||||||
|
The embed syntax allows you to insert other file resources into the current page.
|
||||||
|
|
||||||
|
### Syntax
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[filename]]
|
||||||
|
![[filename#heading]]
|
||||||
|
![[filename#heading#subheading]]
|
||||||
|
```
|
||||||
|
|
||||||
|
Filename search rules are the same as [Wiki Links](#filename-search-rules).
|
||||||
|
|
||||||
|
::: info Resources starting with `/` or having no path prefix like `./` are loaded from the `public` directory
|
||||||
|
:::
|
||||||
|
|
||||||
|
### Image Embeds
|
||||||
|
|
||||||
|
**Syntax:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[image]]
|
||||||
|
![[image|300]]
|
||||||
|
![[image|300x200]]
|
||||||
|
```
|
||||||
|
|
||||||
|
Supported formats: `jpg`, `jpeg`, `png`, `gif`, `avif`, `webp`, `svg`, `bmp`, `ico`, `tiff`, `apng`, `jfif`, `pjpeg`, `pjp`, `xbm`
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
::: demo markdown title="Basic Image" expanded
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[images/custom-hero.jpg]]
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: demo markdown title="Set Width" expanded
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[images/custom-hero.jpg|300]]
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: demo markdown title="Set Width and Height" expanded
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[images/custom-hero.jpg|300x200]]
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
### PDF Embeds
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> PDF embeds require the `markdown.pdf` plugin to be enabled for proper functionality.
|
||||||
|
|
||||||
|
**Syntax:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[document.pdf]]
|
||||||
|
![[document.pdf#page=1]] <!-- #page=1 means first page -->
|
||||||
|
![[document.pdf#page=1#height=300]] <!-- #page=page number #height=height -->
|
||||||
|
```
|
||||||
|
|
||||||
|
Supported formats: `pdf`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Audio Embeds
|
||||||
|
|
||||||
|
**Syntax:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[audio file]]
|
||||||
|
```
|
||||||
|
|
||||||
|
Supported formats: `mp3`, `flac`, `wav`, `ogg`, `opus`, `webm`, `acc`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Video Embeds
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Video embeds require the `markdown.artPlayer` plugin to be enabled for proper functionality.
|
||||||
|
|
||||||
|
**Syntax:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[video file]]
|
||||||
|
![[video file#height=400]] <!-- Set video height -->
|
||||||
|
```
|
||||||
|
|
||||||
|
Supported formats: `mp4`, `webm`, `mov`, etc.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Content Fragment Embeds
|
||||||
|
|
||||||
|
Content fragments under a specified heading can be embedded using `#heading`:
|
||||||
|
|
||||||
|
**Input:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
![[my-note]]
|
||||||
|
![[my-note#Heading One]]
|
||||||
|
![[my-note#Heading One#Subheading]]
|
||||||
|
```
|
||||||
|
|
||||||
|
[Obsidian Official - **Insert Files**](https://obsidian.md/en/help/embeds){.readmore}
|
||||||
|
[Obsidian Official - **File Formats**](https://obsidian.md/en/help/file-formats){.readmore}
|
||||||
|
|
||||||
|
## Comments
|
||||||
|
|
||||||
|
Content wrapped in `%%` is treated as a comment and will not be rendered on the page.
|
||||||
|
|
||||||
|
### Syntax
|
||||||
|
|
||||||
|
**Inline Comments:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
This is an %%inline comment%% example.
|
||||||
|
```
|
||||||
|
|
||||||
|
**Block Comments:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
%%
|
||||||
|
This is a block comment.
|
||||||
|
It can span multiple lines.
|
||||||
|
%%
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
**Inline Comments:**
|
||||||
|
|
||||||
|
**Input:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
This is an %%inline comment%% example.
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
This is an %%inline comment%% example.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Block Comments:**
|
||||||
|
|
||||||
|
**Input:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
Content before the comment
|
||||||
|
|
||||||
|
%%
|
||||||
|
This is a block comment.
|
||||||
|
|
||||||
|
It can span multiple lines.
|
||||||
|
%%
|
||||||
|
|
||||||
|
Content after the comment
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
Content before the comment
|
||||||
|
|
||||||
|
%%
|
||||||
|
This is a block comment.
|
||||||
|
%%
|
||||||
|
|
||||||
|
It can span multiple lines.
|
||||||
|
|
||||||
|
[Obsidian Official - **Comments**](https://obsidian.md/en/help/syntax#%E6%B3%A8%E9%87%8B){.readmore}
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Obsidian compatibility features are all enabled by default. You can selectively enable or disable them through configuration:
|
||||||
|
|
||||||
|
```ts title=".vuepress/config.ts"
|
||||||
|
export default defineUserConfig({
|
||||||
|
theme: plumeTheme({
|
||||||
|
plugins: {
|
||||||
|
mdPower: {
|
||||||
|
obsidian: {
|
||||||
|
wikiLink: true, // Wiki Links
|
||||||
|
embedLink: true, // Embeds
|
||||||
|
comment: true, // Comments
|
||||||
|
},
|
||||||
|
pdf: true, // PDF embed functionality
|
||||||
|
artPlayer: true, // Video embed functionality
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuration Options
|
||||||
|
|
||||||
|
:::: field-group
|
||||||
|
|
||||||
|
::: field name="wikiLink" type="boolean" default="true" optional
|
||||||
|
Enable Wiki Links syntax.
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: field name="embedLink" type="boolean" default="true" optional
|
||||||
|
Enable embed content syntax.
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: field name="comment" type="boolean" default="true" optional
|
||||||
|
Enable comment syntax.
|
||||||
|
:::
|
||||||
|
|
||||||
|
::::
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- These plugins provide **compatibility support** and do not fully implement all of Obsidian's functionality
|
||||||
|
- Some Obsidian-specific features (such as internal link graph views, bidirectional links, etc.) are outside the scope of this support
|
||||||
|
- When embedding content, the embedded page also participates in the theme's build process
|
||||||
|
- PDF embeds require the `markdown.pdf` plugin to be enabled simultaneously
|
||||||
|
- Video embeds require the `markdown.artPlayer` plugin to be enabled simultaneously
|
||||||
|
- Embed resources starting with `/` or using `./` form are loaded from the `public` directory
|
||||||
@ -12,7 +12,7 @@ This could be to pique readers' curiosity or simply to add a bit of reading diff
|
|||||||
|
|
||||||
To satisfy this playful intention, the theme provides a fun little feature called **"plot" text**. It looks like this:
|
To satisfy this playful intention, the theme provides a fun little feature called **"plot" text**. It looks like this:
|
||||||
|
|
||||||
:::demo-wrapper
|
:::window
|
||||||
Did you know that !!Lu Xun!! once said: "!!I never said this!!!" It was an enlightening revelation that deeply
|
Did you know that !!Lu Xun!! once said: "!!I never said this!!!" It was an enlightening revelation that deeply
|
||||||
inspired me, filling me with unparalleled strength! So, !!I turned over in bed!!!
|
inspired me, filling me with unparalleled strength! So, !!I turned over in bed!!!
|
||||||
:::
|
:::
|
||||||
@ -84,7 +84,7 @@ You can also control behavior through attribute syntax:
|
|||||||
|
|
||||||
Use the `plot` option in Frontmatter to control the default behavior of this feature on the current page:
|
Use the `plot` option in Frontmatter to control the default behavior of this feature on the current page:
|
||||||
|
|
||||||
```
|
```md
|
||||||
---
|
---
|
||||||
plot:
|
plot:
|
||||||
trigger: hover
|
trigger: hover
|
||||||
@ -102,7 +102,7 @@ Did you know that !!Lu Xun!! once said: "!!I never said this!!!" It was an enlig
|
|||||||
|
|
||||||
**Output**:
|
**Output**:
|
||||||
|
|
||||||
:::demo-wrapper
|
:::window
|
||||||
Did you know that !!Lu Xun!! once said: "!!I never said this!!!" It was an enlightening revelation that
|
Did you know that !!Lu Xun!! once said: "!!I never said this!!!" It was an enlightening revelation that
|
||||||
deeply inspired me, filling me with unparalleled strength! So, !!I turned over in bed!!!!
|
deeply inspired me, filling me with unparalleled strength! So, !!I turned over in bed!!!!
|
||||||
:::
|
:::
|
||||||
@ -118,7 +118,7 @@ Blur effect + click: !!Click to see me!!{.blur .click}
|
|||||||
|
|
||||||
**Output**:
|
**Output**:
|
||||||
|
|
||||||
:::demo-wrapper
|
:::window
|
||||||
Mask effect + hover: !!Hover to see me!!{.mask .hover}
|
Mask effect + hover: !!Hover to see me!!{.mask .hover}
|
||||||
|
|
||||||
Mask effect + click: !!Click to see me!!{.mask .click}
|
Mask effect + click: !!Click to see me!!{.mask .click}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: qrcode
|
title: QR Code
|
||||||
icon: uiw:qrcode
|
icon: uiw:qrcode
|
||||||
createTime: 2025/12/05 16:16:06
|
createTime: 2025/12/05 10:37:43
|
||||||
permalink: /en/guide/markdown/qrcode/
|
permalink: /en/guide/markdown/qrcode/
|
||||||
badge: 新
|
badge: New
|
||||||
---
|
---
|
||||||
|
|
||||||
@[qrcode](https://github.com/pengzhanbo/vuepress-theme-plume)
|
@[qrcode](https://github.com/pengzhanbo/vuepress-theme-plume)
|
||||||
|
|||||||
@ -77,7 +77,7 @@ which represent the bound value of the tab and whether the tab is currently acti
|
|||||||
|
|
||||||
**Input:**
|
**Input:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
::: tabs
|
::: tabs
|
||||||
@tab npm
|
@tab npm
|
||||||
|
|
||||||
|
|||||||
@ -94,7 +94,7 @@ export default defineUserConfig({
|
|||||||
{
|
{
|
||||||
type: 'doc',
|
type: 'doc',
|
||||||
dir: 'guide',
|
dir: 'guide',
|
||||||
title: '指南',
|
title: 'Guide',
|
||||||
// autoFrontmatter: true, // Theme built-in configuration
|
// autoFrontmatter: true, // Theme built-in configuration
|
||||||
autoFrontmatter: {
|
autoFrontmatter: {
|
||||||
title: true, // Auto-generate title
|
title: true, // Auto-generate title
|
||||||
@ -117,7 +117,7 @@ export default defineThemeConfig({
|
|||||||
{
|
{
|
||||||
type: 'doc',
|
type: 'doc',
|
||||||
dir: 'guide',
|
dir: 'guide',
|
||||||
title: '指南',
|
title: 'Guide',
|
||||||
// autoFrontmatter: true, // Theme built-in configuration
|
// autoFrontmatter: true, // Theme built-in configuration
|
||||||
autoFrontmatter: {
|
autoFrontmatter: {
|
||||||
title: true, // Auto-generate title
|
title: true, // Auto-generate title
|
||||||
@ -297,23 +297,23 @@ Example:
|
|||||||
|
|
||||||
::: code-tree
|
::: code-tree
|
||||||
|
|
||||||
```md title="docs/blog/服务.md"
|
```md title="docs/blog/service.md"
|
||||||
---
|
---
|
||||||
title: 服务
|
title: Service
|
||||||
permalink: /blog/wu-fu/
|
permalink: /blog/service/
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
```md title="docs/blog/都城.md"
|
```md title="docs/blog/capital.md"
|
||||||
---
|
---
|
||||||
title: 都城
|
title: Capital
|
||||||
permalink: /blog/dou-cheng/
|
permalink: /blog/capital/
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
You probably noticed that in the example, the permalink for the `都城.md` file is `/blog/dou-cheng/`,
|
You probably noticed that in the example, the permalink for the `capital.md` file is `/blog/capital/`,
|
||||||
which is incorrect. This is because `pinyin-pro`'s default dictionary cannot accurately identify polyphonic
|
which is incorrect. This is because `pinyin-pro`'s default dictionary cannot accurately identify polyphonic
|
||||||
characters. If you need a more precise conversion result,you can manually install `@pinyin-pro/data`,
|
characters. If you need a more precise conversion result,you can manually install `@pinyin-pro/data`,
|
||||||
and the theme will automatically load this dictionary to improve accuracy.
|
and the theme will automatically load this dictionary to improve accuracy.
|
||||||
@ -326,9 +326,9 @@ npm i @pinyin-pro/data
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
```md title="docs/blog/都城.md"
|
```md title="docs/blog/capital.md"
|
||||||
---
|
---
|
||||||
title: 都城
|
title: Capital
|
||||||
permalink: /blog/du-cheng/
|
permalink: /blog/capital/
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|||||||
@ -595,7 +595,7 @@ title: Article Title
|
|||||||
cover: /images/cover.jpg
|
cover: /images/cover.jpg
|
||||||
coverStyle:
|
coverStyle:
|
||||||
layout: left
|
layout: left
|
||||||
ratio: 16:9
|
ratio: 16/9
|
||||||
width: 300
|
width: 300
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
@ -606,7 +606,7 @@ Display effect:
|
|||||||
<VPPostItem
|
<VPPostItem
|
||||||
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
||||||
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
||||||
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing', coverStyle: { layout: 'left', ratio: '16:9', width: 300 } }"
|
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing', coverStyle: { layout: 'left', ratio: '16/9', width: 300 } }"
|
||||||
:index="1"
|
:index="1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -621,7 +621,7 @@ title: Article Title
|
|||||||
cover: /images/cover.jpg
|
cover: /images/cover.jpg
|
||||||
coverStyle:
|
coverStyle:
|
||||||
layout: left
|
layout: left
|
||||||
ratio: 16:9
|
ratio: 16/9
|
||||||
width: 300
|
width: 300
|
||||||
compact: true
|
compact: true
|
||||||
---
|
---
|
||||||
@ -634,7 +634,7 @@ Display effect:
|
|||||||
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
||||||
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
||||||
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
||||||
coverStyle: { layout: 'left', ratio: '16:9', width: 300, compact: true } }"
|
coverStyle: { layout: 'left', ratio: '16/9', width: 300, compact: true } }"
|
||||||
:index="1"
|
:index="1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -650,7 +650,7 @@ title: Article Title
|
|||||||
cover: /images/cover.jpg
|
cover: /images/cover.jpg
|
||||||
coverStyle:
|
coverStyle:
|
||||||
layout: top
|
layout: top
|
||||||
ratio: 16:9
|
ratio: 16/9
|
||||||
width: 300
|
width: 300
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
@ -662,7 +662,7 @@ Display effect:
|
|||||||
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
||||||
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
||||||
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
||||||
coverStyle: { layout: 'top', ratio: '16:9', width: 300 } }"
|
coverStyle: { layout: 'top', ratio: '16/9', width: 300 } }"
|
||||||
:index="1"
|
:index="1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -684,7 +684,7 @@ export default defineUserConfig({
|
|||||||
title: 'Blog',
|
title: 'Blog',
|
||||||
postCover: {
|
postCover: {
|
||||||
layout: 'left',
|
layout: 'left',
|
||||||
ratio: '16:9',
|
ratio: '16/9',
|
||||||
width: 300,
|
width: 300,
|
||||||
compact: true
|
compact: true
|
||||||
}
|
}
|
||||||
@ -701,12 +701,28 @@ type PostCoverLayout = 'left' | 'right' | 'odd-left' | 'odd-right' | 'top'
|
|||||||
|
|
||||||
interface PostCoverStyle {
|
interface PostCoverStyle {
|
||||||
layout?: PostCoverLayout // Layout position
|
layout?: PostCoverLayout // Layout position
|
||||||
ratio?: number | `${number}:${number}` // Aspect ratio, default '4:3'
|
ratio?: number | `${number}/${number}` | `${number}:${number}` // Aspect ratio, default '4/3'
|
||||||
width?: number // Width (effective for left/right layouts), default 240
|
width?: number // Width (effective for left/right layouts), default 240
|
||||||
compact?: boolean // Compact mode, default false
|
compact?: boolean // Compact mode, default false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
:::warning Known Issue: Parsing Problem with `ratio` in Markdown Frontmatter
|
||||||
|
|
||||||
|
When defining `ratio` in markdown frontmatter, using the `:` separator may cause parsing errors.
|
||||||
|
It is recommended to use the `/` separator instead.
|
||||||
|
|
||||||
|
If you still prefer to use `:`, you can wrap it with `''`. Example:
|
||||||
|
|
||||||
|
```md '16:9'
|
||||||
|
---
|
||||||
|
coverStyle:
|
||||||
|
ratio: '16:9' # instead of ratio: 16:9
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
Special layout modes:
|
Special layout modes:
|
||||||
|
|
||||||
- `odd-left` - Odd items left, even items right
|
- `odd-left` - Odd items left, even items right
|
||||||
@ -719,21 +735,21 @@ Special layout modes:
|
|||||||
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
||||||
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
||||||
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
||||||
coverStyle: { layout: 'odd-left', ratio: '16:9', width: 300, compact: true } }"
|
coverStyle: { layout: 'odd-left', ratio: '16/9', width: 300, compact: true } }"
|
||||||
:index="0"
|
:index="0"
|
||||||
/>
|
/>
|
||||||
<VPPostItem
|
<VPPostItem
|
||||||
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
||||||
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
||||||
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
||||||
coverStyle: { layout: 'odd-left', ratio: '16:9', width: 300,compact: true } }"
|
coverStyle: { layout: 'odd-left', ratio: '16/9', width: 300,compact: true } }"
|
||||||
:index="1"
|
:index="1"
|
||||||
/>
|
/>
|
||||||
<VPPostItem
|
<VPPostItem
|
||||||
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
:post="{ path: '/article/ecxnxxd0/', title: 'Article Title',
|
||||||
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
categoryList: [{id:'65f30c',sort:4,name:'Tutorial'}], createTime: '2024/09/18 09:19:36',
|
||||||
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
lang:'en-US', excerpt:'', cover: 'https://api.pengzhanbo.cn/wallpaper/bing',
|
||||||
coverStyle: { layout: 'odd-left', ratio: '16:9', width: 300, compact: true } }"
|
coverStyle: { layout: 'odd-left', ratio: '16/9', width: 300, compact: true } }"
|
||||||
:index="2"
|
:index="2"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -744,8 +760,6 @@ Automatically switches to `top` layout on narrow-screen devices to ensure displa
|
|||||||
|
|
||||||
## Article Metadata
|
## Article Metadata
|
||||||
|
|
||||||
## 文章元数据
|
|
||||||
|
|
||||||
In the collection, the `meta` option allows you to set the display method of article metadata,
|
In the collection, the `meta` option allows you to set the display method of article metadata,
|
||||||
This setting will directly affect the display of metadata on both the **article list page** and the **article content page**:
|
This setting will directly affect the display of metadata on both the **article list page** and the **article content page**:
|
||||||
|
|
||||||
@ -763,7 +777,7 @@ export default defineUserConfig({
|
|||||||
{
|
{
|
||||||
type: 'post',
|
type: 'post',
|
||||||
dir: 'blog',
|
dir: 'blog',
|
||||||
title: '博客',
|
title: 'Blog',
|
||||||
// [!code hl:11]
|
// [!code hl:11]
|
||||||
meta: {
|
meta: {
|
||||||
tags: true, // Whether to display labels
|
tags: true, // Whether to display labels
|
||||||
@ -792,7 +806,7 @@ export default defineThemeConfig({
|
|||||||
{
|
{
|
||||||
type: 'post',
|
type: 'post',
|
||||||
dir: 'blog',
|
dir: 'blog',
|
||||||
title: '博客',
|
title: 'Blog',
|
||||||
// [!code hl:11]
|
// [!code hl:11]
|
||||||
meta: {
|
meta: {
|
||||||
tags: true, // Whether to display labels
|
tags: true, // Whether to display labels
|
||||||
|
|||||||
@ -28,10 +28,10 @@ A typical VuePress static site has the following file structure:
|
|||||||
:::file-tree
|
:::file-tree
|
||||||
|
|
||||||
- my-site
|
- my-site
|
||||||
- docs \# Source directory
|
- docs # Source directory
|
||||||
- .vuepress/
|
- .vuepress/
|
||||||
- …
|
- …
|
||||||
- README.md \# Homepage
|
- README.md # Homepage
|
||||||
- package.json
|
- package.json
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|||||||
@ -13,7 +13,7 @@ whether you are creating a **technical blog**, **personal journal**, **product d
|
|||||||
**knowledge base**, or **tutorial series**.
|
**knowledge base**, or **tutorial series**.
|
||||||
|
|
||||||
Deep optimizations have been applied to typography and image display,
|
Deep optimizations have been applied to typography and image display,
|
||||||
with extensive enhancements specifically for Markdown syntax.This allows you to effortlessly
|
with extensive enhancements specifically for Markdown syntax. This allows you to effortlessly
|
||||||
create professional content that is **aesthetically pleasing, highly readable, and expressive**.
|
create professional content that is **aesthetically pleasing, highly readable, and expressive**.
|
||||||
|
|
||||||
::: details New to VuePress?
|
::: details New to VuePress?
|
||||||
@ -42,7 +42,7 @@ a more beautiful, clean, and user-friendly reading experience.
|
|||||||
==content encryption==, and ==article watermarking==.
|
==content encryption==, and ==article watermarking==.
|
||||||
- **Code Presentation**: Support for code block ==grouping==, ==collapsing==, ==focusing==,
|
- **Code Presentation**: Support for code block ==grouping==, ==collapsing==, ==focusing==,
|
||||||
==line highlighting==, ==diff comparison==, and embedding ==code demos== from platforms like CodePen, JSFiddle, and CodeSandbox.
|
==line highlighting==, ==diff comparison==, and embedding ==code demos== from platforms like CodePen, JSFiddle, and CodeSandbox.
|
||||||
- **Icon System**: Integration with [iconify](https://icon-sets.iconify.d/) providing access to
|
- **Icon System**: Integration with [iconify](https://icon-sets.iconify.design/) providing access to
|
||||||
**200,000+** ==icons==, with optional support for `iconfont` / `fontawesome` icon libraries.
|
**200,000+** ==icons==, with optional support for `iconfont` / `fontawesome` icon libraries.
|
||||||
- **Media Embedding**: Support for ==PDF embedding==, and ==Bilibili/Youtube/Local Video== embedding.
|
- **Media Embedding**: Support for ==PDF embedding==, and ==Bilibili/Youtube/Local Video== embedding.
|
||||||
- **Chart Rendering**: Integration with multiple ==chart engines== including chart.js, Echarts, Mermaid, Flowchart, Markmap, and PlantUML.
|
- **Chart Rendering**: Integration with multiple ==chart engines== including chart.js, Echarts, Mermaid, Flowchart, Markmap, and PlantUML.
|
||||||
|
|||||||
@ -13,22 +13,22 @@ For projects created via the [command-line tool](./usage.md#command-line-install
|
|||||||
::: file-tree
|
::: file-tree
|
||||||
|
|
||||||
- .git/
|
- .git/
|
||||||
- **docs** \# Documentation source directory
|
- **docs** # Documentation source directory
|
||||||
- .vuepress \# VuePress configuration directory
|
- .vuepress/ # VuePress configuration directory
|
||||||
- public/ \# Static assets
|
- public/ # Static assets
|
||||||
- client.ts \# Client configuration (optional)
|
- client.ts # Client configuration (optional)
|
||||||
- collections.ts \# Collections configuration (optional)
|
- collections.ts # Collections configuration (optional)
|
||||||
- config.ts \# VuePress main configuration
|
- config.ts # VuePress main configuration
|
||||||
- navbar.ts \# Navbar configuration (optional)
|
- navbar.ts # Navbar configuration (optional)
|
||||||
- plume.config.ts \# Theme configuration file (optional)
|
- plume.config.ts # Theme configuration file (optional)
|
||||||
- demo \# `doc` type collection
|
- demo # `doc` type collection
|
||||||
- foo.md
|
- foo.md
|
||||||
- bar.md
|
- bar.md
|
||||||
- blog \# `post` type collection
|
- blog # `post` type collection
|
||||||
- preview \# Blog category
|
- preview # Blog category
|
||||||
- markdown.md \# Category article
|
- markdown.md # Category article
|
||||||
- article.md \# Blog article
|
- article.md # Blog article
|
||||||
- README.md \# Site homepage
|
- README.md # Site homepage
|
||||||
- …
|
- …
|
||||||
- package.json
|
- package.json
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|||||||
@ -33,7 +33,7 @@ A typical project structure might look like:
|
|||||||
- rust # Rust Programming Notes
|
- rust # Rust Programming Notes
|
||||||
- tuple.md
|
- tuple.md
|
||||||
- struct.md
|
- struct.md
|
||||||
- README.md # Site Homepage
|
- README.md # Site Homepage
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Configuration via `sidebar`
|
### Configuration via `sidebar`
|
||||||
|
|||||||
@ -35,7 +35,7 @@ Page content starts after the second `---`.
|
|||||||
Frontmatter is a configuration block using
|
Frontmatter is a configuration block using
|
||||||
[YAML](https://dev.to/paulasantamaria/introduction-to-yaml-125f) format, located at the top of a Markdown file and delimited by `---`.
|
[YAML](https://dev.to/paulasantamaria/introduction-to-yaml-125f) format, located at the top of a Markdown file and delimited by `---`.
|
||||||
|
|
||||||
It is recommended to read the [Frontmatter Detailed Guide](../../../../4.教程/frontmatter.md) for the complete syntax specification.
|
It is recommended to read the [Frontmatter Detailed Guide](../auto-frontmatter.md) for the complete syntax specification.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## Automatic Frontmatter Generation
|
## Automatic Frontmatter Generation
|
||||||
@ -139,14 +139,14 @@ The numeric part serves as the **sorting basis**. Directories without numbers ar
|
|||||||
::: file-tree
|
::: file-tree
|
||||||
|
|
||||||
- docs
|
- docs
|
||||||
- blog \# post type collection
|
- blog # post type collection
|
||||||
- 1.Frontend
|
- 1.Frontend
|
||||||
- 1.html/
|
- 1.html/
|
||||||
- 2.css/
|
- 2.css/
|
||||||
- 3.javascript/
|
- 3.javascript/
|
||||||
- 2.Backend/
|
- 2.Backend/
|
||||||
- DevOps/
|
- DevOps/
|
||||||
- typescript \# doc type collection
|
- typescript # doc type collection
|
||||||
- 1.Basics
|
- 1.Basics
|
||||||
- 1.Variables.md
|
- 1.Variables.md
|
||||||
- 2.Types.md
|
- 2.Types.md
|
||||||
|
|||||||
@ -532,7 +532,8 @@ Using the demo container to wrap demo code in a markdown file allows for quick d
|
|||||||
/* css code */
|
/* css code */
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
```
|
````
|
||||||
|
|
||||||
::::
|
::::
|
||||||
|
|
||||||
You can also wrap `::: code-tabs` within `::: demo` for better code block presentation:
|
You can also wrap `::: code-tabs` within `::: demo` for better code block presentation:
|
||||||
@ -562,7 +563,8 @@ You can also wrap `::: code-tabs` within `::: demo` for better code block presen
|
|||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
::::
|
::::
|
||||||
```
|
````
|
||||||
|
|
||||||
:::::
|
:::::
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@ -5,19 +5,19 @@ createTime: 2024/04/22 09:44:37
|
|||||||
permalink: /en/guide/repl/kotlin/
|
permalink: /en/guide/repl/kotlin/
|
||||||
---
|
---
|
||||||
|
|
||||||
## 概述
|
## Overview
|
||||||
|
|
||||||
主题提供了 Kotlin 代码演示,支持 在线运行 Kotlin 代码。
|
The theme provides Kotlin code demonstrations, supporting online execution of Kotlin code.
|
||||||
|
|
||||||
::: important
|
::: important
|
||||||
该功能通过将 代码提交到 服务器 进行 编译并执行,且一次只能提交单个代码文件。
|
This feature works by submitting code to a server for compilation and execution, and only a single code file can be submitted at a time.
|
||||||
|
|
||||||
因此,请不要使用此功能 执行 过于复杂的代码,也不要过于频繁的进行执行请求。
|
Therefore, please do not use this feature to execute overly complex code, and avoid making execution requests too frequently.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## 配置
|
## Configuration
|
||||||
|
|
||||||
该功能默认不启用,你可以通过配置来启用它。
|
This feature is disabled by default. You can enable it through configuration.
|
||||||
|
|
||||||
```ts title=".vuepress/config.ts"
|
```ts title=".vuepress/config.ts"
|
||||||
export default defineUserConfig({
|
export default defineUserConfig({
|
||||||
@ -31,39 +31,39 @@ export default defineUserConfig({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
## 使用
|
## Usage
|
||||||
|
|
||||||
使用 `::: kotlin-repl` 容器语法 将 kotlin 代码块包裹起来。主题会检查代码块并添加执行按钮。
|
Use the `::: kotlin-repl` container syntax to wrap Kotlin code blocks. The theme will inspect the code block and add an execution button.
|
||||||
|
|
||||||
### 只读代码演示
|
### Read-Only Code Demo
|
||||||
|
|
||||||
kotlin 代码演示默认是只读的,不可编辑。
|
Kotlin code demos are read-only by default and cannot be edited.
|
||||||
|
|
||||||
````md
|
````md
|
||||||
::: kotlin-repl title="自定义标题"
|
::: kotlin-repl title="Custom Title"
|
||||||
```kotlin
|
```kotlin
|
||||||
// your kotlin code
|
// your kotlin code
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
````
|
````
|
||||||
|
|
||||||
### 可编辑代码演示
|
### Editable Code Demo
|
||||||
|
|
||||||
如果需要在线编辑并执行,需要将代码块包裹在 `::: kotlin-repl editable` 容器语法中
|
If you need online editing and execution, wrap the code block in the `::: kotlin-repl editable` container syntax.
|
||||||
|
|
||||||
````md
|
````md
|
||||||
::: kotlin-repl editable title="自定义标题"
|
::: kotlin-repl editable title="Custom Title"
|
||||||
```kotlin
|
```kotlin
|
||||||
// your kotlin code
|
// your kotlin code
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
````
|
````
|
||||||
|
|
||||||
## 示例
|
## Examples
|
||||||
|
|
||||||
### 打印内容
|
### Print Content
|
||||||
|
|
||||||
**输入:**
|
**Input:**
|
||||||
|
|
||||||
````md
|
````md
|
||||||
::: kotlin-repl
|
::: kotlin-repl
|
||||||
@ -78,7 +78,7 @@ fun main(args: Array<String>) {
|
|||||||
:::
|
:::
|
||||||
````
|
````
|
||||||
|
|
||||||
**输出:**
|
**Output:**
|
||||||
|
|
||||||
::: kotlin-repl
|
::: kotlin-repl
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### 运算
|
### Computation
|
||||||
|
|
||||||
::: kotlin-repl
|
::: kotlin-repl
|
||||||
|
|
||||||
@ -109,9 +109,9 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### 可编辑代码演示
|
### Editable Code Demo
|
||||||
|
|
||||||
**输入:**
|
**Input:**
|
||||||
|
|
||||||
````md
|
````md
|
||||||
::: kotlin-repl editable
|
::: kotlin-repl editable
|
||||||
@ -126,7 +126,7 @@ fun main(args: Array<String>) {
|
|||||||
:::
|
:::
|
||||||
````
|
````
|
||||||
|
|
||||||
**输出:**
|
**Output:**
|
||||||
|
|
||||||
::: kotlin-repl editable
|
::: kotlin-repl editable
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
title: Frequently Asked Questions
|
title: Frequently Asked Questions
|
||||||
createTime: 2025/10/08 08:47:36
|
createTime: 2025/10/08 08:47:36
|
||||||
permalink: /en/faq/
|
permalink: /en/faq/
|
||||||
|
article: false
|
||||||
---
|
---
|
||||||
|
|
||||||
This document primarily covers common issues and solutions you might encounter while using the theme.
|
This document primarily covers common issues and solutions you might encounter while using the theme.
|
||||||
@ -85,3 +86,104 @@ files (like `package-lock.json` or `pnpm-lock.yaml`) might be corrupted.
|
|||||||
|
|
||||||
Please directly delete the dependency lock files (`package-lock.json`, `pnpm-lock.yaml`, etc.)
|
Please directly delete the dependency lock files (`package-lock.json`, `pnpm-lock.yaml`, etc.)
|
||||||
and the `node_modules` directory, then reinstall the dependencies.
|
and the `node_modules` directory, then reinstall the dependencies.
|
||||||
|
|
||||||
|
## How to hide the page footer?
|
||||||
|
|
||||||
|
You can hide the footer by adding `footer: false` in the frontmatter of the Markdown file.
|
||||||
|
|
||||||
|
```md title="post.md"
|
||||||
|
---
|
||||||
|
footer: false
|
||||||
|
---
|
||||||
|
|
||||||
|
content
|
||||||
|
```
|
||||||
|
|
||||||
|
[Configuration Documentation: **frontmatter > Footer**](../config/frontmatter/basic.md#footer){.read-more}
|
||||||
|
|
||||||
|
Or you can hide the footer for all pages on the main site by adding `footer: false` in the theme configuration file.
|
||||||
|
|
||||||
|
```ts title=".vuepress/config.ts"
|
||||||
|
export default defineUserConfig({
|
||||||
|
theme: plumeTheme({
|
||||||
|
footer: false, // [!code ++]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
[Configuration Documentation: **Theme Configuration**](../config/theme.md#footer){.read-more}
|
||||||
|
|
||||||
|
## Build error: `JavaScript heap out of memory`
|
||||||
|
|
||||||
|
When executing `npm run docs:build`, you encounter an error similar to:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
<--- Last few GCs --->
|
||||||
|
|
||||||
|
[69161:0x7fe63aa00000] 137006 ms: xxxxxx
|
||||||
|
[69161:0x7fe63aa00000] 139327 ms: xxxxxxxx
|
||||||
|
|
||||||
|
<--- JS stacktrace --->
|
||||||
|
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
|
||||||
|
----- Native stack trace -----
|
||||||
|
|
||||||
|
1: 0x107ce7c84 xxxxxxxxxxxx
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
This is due to insufficient Node.js memory.
|
||||||
|
|
||||||
|
Modify the Node.js memory limit by adding the following environment variables:
|
||||||
|
|
||||||
|
**Method 1: In the current terminal session**:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export NODE_OPTIONS="--max_old_space_size=8192"
|
||||||
|
npm run docs:build
|
||||||
|
```
|
||||||
|
|
||||||
|
==Note that this method is only effective for the current terminal session.=={.warning}
|
||||||
|
|
||||||
|
**Method 2: In the local environment**:
|
||||||
|
|
||||||
|
If you need to keep this environment variable long-term, you can modify the Node.js memory limit in your local environment:
|
||||||
|
|
||||||
|
:::: steps
|
||||||
|
|
||||||
|
- Install `cross-env` in your project
|
||||||
|
|
||||||
|
::: npm-to
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install -D cross-env
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
- Add `scripts` in `package.json`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"docs:build-local": "cross-env NODE_OPTIONS=\"--max_old_space_size=8192\" vuepress build docs --clean-cache --clean-temp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
::::
|
||||||
|
|
||||||
|
When building locally, use `npm run docs:build-local` to build the package.
|
||||||
|
|
||||||
|
**Method 3: In GitHub Actions**:
|
||||||
|
|
||||||
|
Modify the `.github/workflows/deploy.yml` file and add the following environment variables:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# ...
|
||||||
|
- name: Build VuePress site
|
||||||
|
env: # [!code ++:2]
|
||||||
|
NODE_OPTIONS: --max_old_space_size=8192
|
||||||
|
run: npm run docs:build
|
||||||
|
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export default defineUserConfig({
|
|||||||
:::
|
:::
|
||||||
````
|
````
|
||||||
|
|
||||||
图标配置请查看 [chart.js] 文档 。
|
图表配置请查看 [chart.js] 文档。
|
||||||
|
|
||||||
## 示例
|
## 示例
|
||||||
|
|
||||||
|
|||||||
@ -342,6 +342,6 @@ e=>end: End:>http://www.yahoo.com
|
|||||||
|
|
||||||
如果要在流程图中强调特定路径,则可以另外定义它,如下所示:
|
如果要在流程图中强调特定路径,则可以另外定义它,如下所示:
|
||||||
|
|
||||||
```
|
```md
|
||||||
st@>op1({"stroke":"Red"})@>cond({"stroke":"Red","stroke-width":6,"arrow-end":"classic-wide-long"})@>c2({"stroke":"Red"})@>op2({"stroke":"Red"})@>e({"stroke":"Red"})
|
st@>op1({"stroke":"Red"})@>cond({"stroke":"Red","stroke-width":6,"arrow-end":"classic-wide-long"})@>c2({"stroke":"Red"})@>op2({"stroke":"Red"})@>e({"stroke":"Red"})
|
||||||
```
|
```
|
||||||
|
|||||||
@ -260,7 +260,7 @@ object NewYork
|
|||||||
|
|
||||||
map CapitalCity {
|
map CapitalCity {
|
||||||
UK *-> London
|
UK *-> London
|
||||||
USA *--> Washington
|
USA*--> Washington
|
||||||
Germany *---> Berlin
|
Germany *---> Berlin
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,9 +427,9 @@ rectangle "Investigate" as I <<$bProcess>><<behavior>> #Business
|
|||||||
rectangle "Pay" as P <<$bProcess>><<behavior>> #Business
|
rectangle "Pay" as P <<$bProcess>><<behavior>> #Business
|
||||||
|
|
||||||
HC *-down- CI
|
HC *-down- CI
|
||||||
HC *-down- NAS
|
HC*-down- NAS
|
||||||
HC *-down- V
|
HC *-down- V
|
||||||
HC *-down- I
|
HC*-down- I
|
||||||
HC *-down- P
|
HC *-down- P
|
||||||
|
|
||||||
CI -right->> NAS
|
CI -right->> NAS
|
||||||
@ -574,16 +574,16 @@ caption figure 1
|
|||||||
title My super title
|
title My super title
|
||||||
|
|
||||||
* <&flag>Debian
|
* <&flag>Debian
|
||||||
** <&globe>Ubuntu
|
**<&globe>Ubuntu
|
||||||
*** Linux Mint
|
***Linux Mint
|
||||||
*** Kubuntu
|
*** Kubuntu
|
||||||
*** Lubuntu
|
***Lubuntu
|
||||||
*** KDE Neon
|
*** KDE Neon
|
||||||
** <&graph>LMDE
|
** <&graph>LMDE
|
||||||
** <&pulse>SolydXK
|
**<&pulse>SolydXK
|
||||||
** <&people>SteamOS
|
** <&people>SteamOS
|
||||||
** <&star>Raspbian with a very long name
|
** <&star>Raspbian with a very long name
|
||||||
*** <s>Raspmbc</s> => OSMC
|
***<s>Raspmbc</s> => OSMC
|
||||||
*** <s>Raspyfi</s> => Volumio
|
*** <s>Raspyfi</s> => Volumio
|
||||||
|
|
||||||
header
|
header
|
||||||
@ -630,9 +630,9 @@ endlegend
|
|||||||
|
|
||||||
```md
|
```md
|
||||||
@startjson
|
@startjson
|
||||||
#highlight "lastName"
|
# highlight "lastName"
|
||||||
#highlight "address" / "city"
|
# highlight "address" / "city"
|
||||||
#highlight "phoneNumbers" / "0" / "number"
|
# highlight "phoneNumbers" / "0" / "number"
|
||||||
{
|
{
|
||||||
"firstName": "John",
|
"firstName": "John",
|
||||||
"lastName": "Smith",
|
"lastName": "Smith",
|
||||||
|
|||||||
@ -7,7 +7,7 @@ permalink: /guide/code/group/
|
|||||||
|
|
||||||
## 概述
|
## 概述
|
||||||
|
|
||||||
代码组(Code Tabs)是 主题 中用于并排展示多个相关代码片段的强大功能。
|
代码组(Code Tabs)是主题中用于并排展示多个相关代码片段的强大功能。
|
||||||
通过标签页形式组织代码,您可以清晰对比不同技术栈、配置方案或语言版本的实现差异。
|
通过标签页形式组织代码,您可以清晰对比不同技术栈、配置方案或语言版本的实现差异。
|
||||||
|
|
||||||
## 基础语法
|
## 基础语法
|
||||||
|
|||||||
@ -48,7 +48,7 @@ export default defineUserConfig({
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```ts:line-numbers
|
```ts:line-numbers
|
||||||
// 启用行号
|
// 启用行号
|
||||||
const line2 = 'This is line 2'
|
const line2 = 'This is line 2'
|
||||||
@ -94,7 +94,7 @@ const line4 = 'This is line 4'
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js{4}
|
```js{4}
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
@ -126,7 +126,7 @@ export default {
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js{1,4,6-8}
|
```js{1,4,6-8}
|
||||||
export default { // Highlighted
|
export default { // Highlighted
|
||||||
data () {
|
data () {
|
||||||
@ -162,10 +162,10 @@ export default { // Highlighted
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
msg: 'Highlighted!' // [\!code highlight]
|
msg: 'Highlighted!' // [\!code highlight]
|
||||||
}
|
}
|
||||||
@ -194,10 +194,10 @@ export default {
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
msg: 'Focused!' // [\!code focus]
|
msg: 'Focused!' // [\!code focus]
|
||||||
}
|
}
|
||||||
@ -241,10 +241,10 @@ pnpm install
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
error: 'Removed', // [\!code --]
|
error: 'Removed', // [\!code --]
|
||||||
warning: 'Added' // [\!code ++]
|
warning: 'Added' // [\!code ++]
|
||||||
@ -288,10 +288,10 @@ mkdir hello && cd hello # [!code ++]
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
error: 'Error', // [\!code error]
|
error: 'Error', // [\!code error]
|
||||||
warning: 'Warning' // [\!code warning]
|
warning: 'Warning' // [\!code warning]
|
||||||
@ -333,7 +333,7 @@ mkdir hello && cd hello # [!code warning]
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```ts
|
```ts
|
||||||
export function foo() { // [\!code word:Hello]
|
export function foo() { // [\!code word:Hello]
|
||||||
const msg = 'Hello World'
|
const msg = 'Hello World'
|
||||||
@ -355,7 +355,7 @@ export function foo() { // [!code word:Hello]
|
|||||||
|
|
||||||
**输入:**
|
**输入:**
|
||||||
|
|
||||||
````
|
````md
|
||||||
```ts
|
```ts
|
||||||
// [\!code word:options:2]
|
// [\!code word:options:2]
|
||||||
const options = { foo: 'bar' }
|
const options = { foo: 'bar' }
|
||||||
|
|||||||
@ -641,7 +641,7 @@ str = 'Hello'
|
|||||||
你应该能够在控制台中查看到相关的错误信息,然后在错误信息的 `description` 中找到对应的错误码。
|
你应该能够在控制台中查看到相关的错误信息,然后在错误信息的 `description` 中找到对应的错误码。
|
||||||
然后再将错误码添加到 `@errors` 中。
|
然后再将错误码添加到 `@errors` 中。
|
||||||
|
|
||||||
不用担心变异失败会终止进程,主题会在编译失败时显示错误信息,同时在代码块中输出未编译的代码。
|
不用担心编译失败会终止进程,主题会在编译失败时显示错误信息,同时在代码块中输出未编译的代码。
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### `@noErrors`
|
### `@noErrors`
|
||||||
|
|||||||
@ -7,7 +7,7 @@ permalink: /guide/components/card-masonry/
|
|||||||
|
|
||||||
## 概述
|
## 概述
|
||||||
|
|
||||||
瀑布流容器是一个 通用的容器组件,你可以把任何内容放到 `<CardMasonry>` 里面,容器会自动计算每一个 **项** 的高度,
|
瀑布流容器是一个通用的容器组件,你可以把任何内容放到 `<CardMasonry>` 里面,容器会自动计算每一个 **项** 的高度,
|
||||||
然后将它们按照瀑布流的方式进行排列。
|
然后将它们按照瀑布流的方式进行排列。
|
||||||
|
|
||||||
::: details 什么是项 ?
|
::: details 什么是项 ?
|
||||||
@ -59,7 +59,7 @@ permalink: /guide/components/card-masonry/
|
|||||||
``` md
|
``` md
|
||||||
::: card-masonry cols="3" gap="16" <!-- [!code hl]-->
|
::: card-masonry cols="3" gap="16" <!-- [!code hl]-->
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<!-- 更多内容 -->
|
<!-- 更多内容 -->
|
||||||
|
|
||||||
@ -77,17 +77,19 @@ permalink: /guide/components/card-masonry/
|
|||||||
``` md
|
``` md
|
||||||
::: card-masonry
|
::: card-masonry
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
:::
|
:::
|
||||||
```
|
```
|
||||||
|
|||||||
@ -7,7 +7,7 @@ permalink: /guide/components/home-box/
|
|||||||
|
|
||||||
## 首页布局容器
|
## 首页布局容器
|
||||||
|
|
||||||
自定义首页时,使用 `<HomeBox>` 提供给 区域 的 包装容器。
|
自定义首页时,使用 `<HomeBox>` 提供给区域的包装容器。
|
||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ permalink: /guide/components/image-card/
|
|||||||
|
|
||||||
使用 `<ImageCard>` 组件在页面中显示图片卡片。
|
使用 `<ImageCard>` 组件在页面中显示图片卡片。
|
||||||
|
|
||||||
图片卡片 有别于 markdown 的 普通插入图片方式,它展示与图片相关的更多信息,包括标题、描述、作者、链接等。
|
图片卡片有别于 markdown 的普通插入图片方式,它展示与图片相关的更多信息,包括标题、描述、作者、链接等。
|
||||||
适用于如 摄影作品、设计作品、宣传海报 等场景。
|
适用于如 摄影作品、设计作品、宣传海报 等场景。
|
||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user