# 1 | 配置Note-Book个人主页

# 1. 配置github项目

# 2. 配置VuePress

# 2.1 安装nvm虚拟环境

安装或升级脚本

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
1

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
1

profile文件配置环境(~/.bash_profile,~/.zshrc,~/.profile,or ~/.bashrc

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
1
2
3

# 2.2 . 配置nodeJS环境

nvm install v12.22.6
nvm use v12.22.6
1
2

使用顺手的包管理器进行初始化

yarn init # npm init
1
# 安装yarn
npm install --global yarn
1
2

# 2.3 安装VuePress

将VuePress安装为本地依赖,官方已经不推荐全局安装VuePress。注:由于依赖了webpack 3.x,npm会生成错误的依赖树,所以官方推荐使用yarn做为项目构建工具

yarn add -D vuepress # npm install -D vuepress
yarn add moment
1
2

# 2.4 测试安装

package.json中添加scripts

{
  "scripts": {
    "docs:dev": "vuepress dev docs",
    "docs:build": "vuepress build docs"
  }
}
1
2
3
4
5
6

本地启动测试服务器

yarn docs:dev # npm run docs:dev
1

浏览器中打开 http://localhost:8080 (opens new window) 进行测试

# 2.5 基本配置

在文档目录(docs)下创建 .vuepress目录,添加配置信息

# 3. 附录

1、VuePress文档: (opens new window)

上次更新: : 3 months ago