1.环境
nodejs
gitee
gitee上创建一个仓库
https://gitee.com/haibatu/blog.git
2.安装
安装hexo
npm install -g hexo #通过npm安装hexo,-g代表全局安装
hexo init blog #初始化
npm install #安装相关依赖
npm install --save hexo-deployer-git
hexo clean #清除所有记录
hexo g #生成静态页面
hexo s #启动服务
目录结构
页面展示
3.修改主题
选择一个主题
将github上的主题下载到 /blog/themes目录下
编辑_config.yml,比较重要的点
deploy:
type: git
#repository: git@gitee.com:haibatu/blog.git
repo: https://gitee.com/haibatu/blog.git
branch: master
theme: hexo-theme-diaspora
url: https://haibatu.gitee.io/blog/
root: /blog
执行命令,一套连招进行部署
hexo clean && hexo g && hexo d
hexo d报错
解决
npm install --save hexo-deployer-git
打开gitee
访问地址
http://haibatu.gitee.io/blog/