vuepress搭建页面&博客

安装 npm install -g vuepress

创建 npm create vuepress

安装依赖 npm install 

http://localhost:8080/  

一些config的配置可以参考vuepress的官方文档 https://www.vuepress.cn/

也可以选择blog 下面是blog的部署

部署

项目的根目录下创建一个deploy.sh的文件

#!/usr/bin/env sh

# 终止一个错误
set -e

# 构建
npm run build

# 进入生成的构建文件夹
cd blog/.vuepress/dist

# 如果你是要部署到自定义域名
# echo 'www.example.com' > CNAME

git init
git add -A
git commit -m 'deploy'

# 如果你想要部署到 https://.github.io 这里就不需要配置base
# git push -f [email protected]:/.github.io.git master

# 如果你想要部署到 https://.github.io/ 
# 也就是说你的仓库地址 https://github.com/artadmire/react-mobx.git react-mobx 就是 
# 只执行这步会发现代码并没有同步到仓库,并且blog咩有样式 需要config.js里面设置base 
# base 默认是/ 这里base配置为 /
# git push -f [email protected]:/.git master:gh-pages
# 执行下面的操作,把代码同步到github
# 链接远程仓库
# 例如 [email protected]:artadmire/react-mobx.git 或者 https://github.com/artadmire/react-mobx.git
# git remote add origin 远程仓库地址(开始可以在远程仓库建一个空项目)
# 拉取远程仓库的文件
# git pull --rebase origin master 
# 同步更新代码
# git push -u origin master

cd -
TIP


# 打开命令窗口 运行一下这个文件 sh deploy.sh

 项目有所改变 都需要运行一下这个文件,部署上去

你可能感兴趣的:(vuepress搭建页面&博客)