vuepress-theme-reco搭建个人博客, 并且项目部署github

1,410 阅读1分钟

vuepress-theme-reco简介

vuepress-theme-reco是一个vuepress主题,旨在添加博客所需的分类、标签墙、分页、评论等功能;

主题追求极简,根据 vuepress 的默认主题修改而成,官方的主题配置仍然适用;

官网地址

vuepress-theme-reco.recoluan.com/

搭建项目

# init
npm install @vuepress-reco/theme-cli -gtheme-cli init my-blog
# install
cd my-blognpm install
# run
npm run dev
# build
npm run build

部署到GitHub

在根路径生成文件deploy.sh

文件内容如下:

# deploy.sh文件
# 确保脚本抛出遇到的错误
set -e
# 生成静态文件
npm run build
# 进入生成的文件夹
cd ./public
git init
git add -A
git commit -m '--deploy'
# <USERNAME> 就是GitHub的用户名
# 如果发布到 https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
# 如果发布到 https://<USERNAME>.github.io/<REPO>
# git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
cd -

双击该文件,完成打包和部署的操作