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

安装

开始安装前,已安装下列应用程序:

  • Node.js (>= nodejs 6.9)
  • Git

开始安装:

1
2
3
4
5
6
npm install -g hexo-cli
hexo init hexo
cd hexo
npm install
hexo g
hexo s

默认情况下,访问网址为: http://localhost:4000/

主题

这里以indigo为例,https://github.com/yscoder/hexo-theme-indigo。

1
git clone https://github.com/yscoder/hexo-theme-indigo themes/indigo

修改_config.yml中的theme:

1
theme: indigo

配置详情见文档,https://github.com/yscoder/hexo-theme-indigo/wiki

hexo admin

安装 hexo-admin

1
npm install --save hexo-admin

修改_config.yml

1
2
3
4
admin:
username: username
password_hash: $2a$10$L.XAIqIWgTc5S1zpvV3MEu7/rH34p4Is/nq824smv8EZ3lIPCp1su
secret: my super secret phrase

启动服务器。默认情况下,访问网址为: http://localhost:4000/admin/

1
hexo s