环境准备
1 | ➜ nvm --version |
本地运行 Hexo
-
初始化 hexo,生成 hexo-blog 目录
1
hexo init hexo-blog
-
进入 hexo-blog 目录,下载 pure 主题和 source 文章
1
2
3
4
5
6
7cd hexo-blog
git clone https://github.com/Dragonliu2018/hexo-theme-pure.git themes/pure
删除默认生成的 _posts 目录
rm -rf source/_posts
git clone https://github.com/Dragonliu2018/hexo-source.git source -
配置 pure,ref link
1
2
3
4
5
6
7
8
9
10npm install hexo-wordcount --save
npm install hexo-generator-json-content --save
npm install hexo-generator-feed --save
npm install hexo-generator-sitemap --save
npm install hexo-generator-baidu-sitemap --save
npm install hexo-neat --save
npm install hexo-translate-title --save
npm un hexo-renderer-marked --save
npm i hexo-renderer-markdown-it-plus --save
npm install hexo-deployer-git --save -
修改 _config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17# 页面中分类等导航词的语言
- language: en
+ language: zh-CN
# 搜索界面的分类部分拼接 url
- url: http://example.com
+ url: https://dragonliu2018.github.io
# 设置主题
- theme: landscape
+ theme: pure
# 设置部署
deploy:
type: git
repo: https://github.com/dragonliu2018/dragonliu2018.github.io.git
branch: master -
运行 hexo
1
2hexo g
hexo s
部署 Github
-
安装 hexo-deployer-git
1
npm install hexo-deployer-git --save
-
修改项目根目录 blog 下的
_config.yml
1
2
3
4deploy:
type: git
repo: https://github.com/dragonliu2018/dragonliu2018.github.io.git
branch: master -
部署
1
hexo g
常用命令
1 | hexo clean |