具体过程
- 安装npm:
yum install npm - 安装hexo:
npm install hexo-cli -g - 初始博客目录:
hexo init blog && cd blog - 按照主题开发安装并更换主题:
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia并更改_config.yml中theme: yilia - 创建博文:
hexo new 'Hexo博客搭建过程' - 在github上创建仓库
${name}.github.com并在_config.yml中deploy更改。deploy: \n type: git \n repo: <git地址> \n branch: master - 解决不能提交到github上问题.
npm install hexo-deployer-git --save - 写好博文
- 清理本地数据库。
hexo clean - 生成静态页面,
hexo generate - 部署到github上.
hexo deploy - 本地调试启动服务器.
hexo server - 修改配置文件
- 将仓库地址设置到
blog目录并切换到dev分支,保存到远端仓库