1.node>= 8.6
2. yarn global add vuepress # 或者:npm install -g vuepress
3. npm install -D vuepress
npm init -y 生成默认配置信息
新建docs文件夹 将 # Hello VuePress 写入新建 docs/README.md文件内
mkdir docs && echo '# Hello VuePress' > docs/README.md
启动语句
yarn docs:dev # npm run docs:dev
启动成功
新建 docs/.vuepress 文件夹 不要落下.
新建 docs/.vuepress/config.js文件里面存放配置 具体设置可以参考 配置 | VuePress
配置ip以及端口号
// .vuepress/config.js
module.exports = {
host: 'localhost', // ip
port: '8888', //端口号
title: '我的技术站', // 设置网站标题
description: '描述:我的技术站',//会在其他页面生效
}
注意关键字后面空格必须加
导航栏以及标题开关 标题内容在 config.js 可参考默认主题配置 | VuePress
// .vuepress/config.js
module.exports = {
host: 'localhost', // ip
port: '8888', //端口号
title: '我的技术站', // 设置网站标题
description: '描述:我的技术站',//会在其他页面生效
themeConfig: {
logo: '/assets/img/logo.png',//设置左上角logo图片
}
}
按标题生成侧边栏
下拉列表
侧边栏可跳转