Appearance
VuePress
- https://v1.vuepress.vuejs.org/zh
- https://vuepress-theme-reco.recoluan.com/views/1.x/local.html
- https://vuepress-theme-reco.recoluan.com/views/1.x/sidebar.html
安装node
配置环境变量
shell
export NODE_OPTIONS=--openssl-legacy-provider
- 创建并进入一个新目录
shell
mkdir vuepress-starter && cd vuepress-starter
- 安装yarn
shell
npm install -g yarn
- 初始化
shell
yarn init
- 将 VuePress 安装为本地依赖
我们已经不再推荐全局安装 VuePress
shell
yarn add -D vuepress
- 创建你的第一篇文档
shell
mkdir docs && echo '# Hello VuePress' > docs/README.md
- 在 package.json 中添加一些 scripts
json
{
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
}
}
- 在本地启动服务器
shell
yarn docs:dev
- 左边栏配置
.vuepress/config.js
js
module.exports = {
theme: 'reco',
title: 'Hello VuePress',
description: 'Just playing around',
themeConfig: {
subSidebar: 'auto',
sidebarDepth: 0,
sidebar: [
'/',
'/jdbc'
]
}
}
- 右边栏主题安装
shell
yarn add vuepress-theme-reco
- 右边栏配置
.vuepress/config.js
json
module.exports = {
theme: 'reco',
themeConfig: {
subSidebar: 'auto',
}
}