搭建过程

npm install hexo-cli -g

创建博客想要放的文件夹 例如 ~/hexo
cd hexo

hexo init

npm install

hexo g

hexo s
然后用浏览器访问http://localhost:4000/

修改_config.yml
翻到最下面,改成如下

1
2
3
4
deploy:
type: git
repo: https://github.com/usename/usename.github.io.git
branch: master

冒号:之后必须有空格

再次
hexo g

提交到github
hexo d

新建文章
hexo new “new bolg”

假如更改了github名字,需要修改_config.yml中的配置
并且执行hero clean,否则提交时报错

参考&致谢

hexo在github上搭建个人博客详细步骤
HEXO+Github,搭建属于自己的博客

使用教程原版

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment