使用说明
安装git和nodejs
安装hexo
1
|
npm install hexo-cli -g
|
下载github库
1
2
3
|
git clone []
查看分支
git branch -a
|
初始化
在项目目录执行
1
2
3
|
hexo init
#安装依赖
npm install
|
测试
安装发布
1
|
npm install hexo-deployer-git --save
|
主题管理
1
2
3
4
5
6
7
|
# 获取远程 card 分支,并切换
$ git checkout -b card origin/card
# 获取远程 master 分支,并切换
$ git checkout -b master origin/master
git checkout [branch] 命令在两个主题之间切换
|
选择依赖安装
Less
主题默认使用 less 作为 css 预处理工具。
1
|
$ npm install hexo-renderer-less --save
|
Feed
用于生成 rss。
1
|
$ npm install hexo-generator-feed --save
|
Json-content
用于生成静态站点数据,用作站内搜索的数据源。
1
|
$ npm install hexo-generator-json-content --save
|
QRCode
用于生成微信分享二维码。
可选,不安装时会请求 jiathis Api 生成二维码。
1
|
$ npm install hexo-helper-qrcode --save
|
开启标签页
修改 hexo/source/tags/index.md 的元数据
1
2
3
|
layout: tags
comments: false
---
|
开启分类页
仅 card theme 支持。
1
|
hexo new page categories
|
修改 hexo/source/categories/index.md 的元数据
1
2
3
|
layout: categories
comments: false
---
|