1. 安装 Hexo

# 1. global (my choice)
npm install -g hexo-cli
# 2. local
npm install hexo
# choose 1 or 2 -> install
# 3. uninstall
npm uninstall hexo

官方参考: Hexo官方文档

2. 初始化仓库

hexo init [blog-repo-name]

cd [blog-repo-name]

git init

git add .

git commit -m "first commit"

git branch -M master

git remote add origin git@github.com:[user-name]/[repo-name].git

git push -u origin master

3. 下载 NexT 主题

cd [blog-dir]

git clone https://github.com/theme-next/hexo-theme-next themes/next

官方指引: hexo-theme-next

4. 配置 NexT 主题

Image.png

hexo clean

hexo g

hexo s

# use webbrowser visit http://localhost:4000

5. 设置部署站点

编辑 _config.yml

deploy:
	type: git
  	repo:
		github: git@github.com:[user-name]/[user-name].github.io.git
  	branch: master

5. 拷贝并修改主题配置文件

cp _config.yml ../../_config.next.yml


# use editor to modify your custom settins

6. 安装部署插件

npm install --save hexo-deployer-git

hexo d