hexo-github-pages

Hexo + github pages 搭建个人博客

一 Hexo

啥是 Hexo

Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。

官方文档

https://hexo.io/zh-cn/docs/setup

1.1 安装

前提 先安装

Node.js (Should be at least nodejs 6.9)

Git

安装

1
npm install -g hexo-cli

1.2 使用

  • 初始化

    1
    2
    3
    $ hexo init <folder>
    $ cd <folder>
    $ npm install
  • 生成静态文件

    1
    hexo g

2 Github Pages

https://pages.github.com/

自定义域名

先安装插件

1
npm install hexo-deployer-git --save

2.1 问题记录

1
2
3
4
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (/Users/xxx/GIT_HEXO_W/xxx.github.io/node_modules/hexo-util/lib/spawn.js:52:19)

解决

生成ssh key

添加ssh key

https://hexo.io/zh-cn/docs/

Hexo 博客搭建指南

手把手教你使用Hexo + Github Pages搭建个人独立博客