外观
VuePress搭建
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| title | string | 默认自动填入文件名 | 文章标题 |
| createTime | string | 当前时间 | 文章创建时间 |
| author | string | 默认自动填入 avatar.name | 文章作者 |
| tags | string[] | [] | 文章标签 |
| sticky | boolean | number | false | 是否置顶, 如果为数字,则数字越大,置顶越靠前 |
| article | boolean | true | 是否在列表页中显示 |
1.初始化
npm init
2.安装 vuepress
npm i -D vuepress@next
# 安装 主题和打包工具
npm i -D vuepress-theme-plume @vuepress/bundler-vite@next3.在 package.json 中添加 script
package.json
{
"scripts": {
"dev": "vuepress dev docs",
"build": "vuepress build docs"
}
}4.新增 .gitignore
node_modules
.temp
.cache5.在 .vuepress/config.{js,ts} 中配置主题
.vuepress/config.ts mkdir .vuepresstouch config.ts
import { defineUserConfig } from 'vuepress'
import { viteBundler } from '@vuepress/bundler-vite'
import { plumeTheme } from 'vuepress-theme-plume'
export default defineUserConfig({
// 请不要忘记设置默认语言
lang: 'zh-CN',
theme: plumeTheme({
// more...
}),
bundler: viteBundler(),
})6. 启动
npm run dev
![[Pasted image 20240313144330.png|300]]
修改默认信息
node_modules/vuepress-theme-plume/lib/node/defaultOptioons.js
node18.16.0报错import {addAbortListener} from 'node:events';
升级node
