git源码
Demo: www.kunlingou.club
搭建
初始博客环境
cnpm i -g hexo-cli
hexo init
cnpm install
配置博客参数
./_config.yml
//部署(提交)模式
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: git@github.com:kunlingou/kunlingou.github.io.git
branch: master
hexo s //启动服务
部署(提交到git)
cnpm i -S hexo-deployer-git
hexo clean
hexo g -d //生成后部署hexo generate hexo deploy
关联域名
- 参考Github建立静态网站(不需要购买服务器)
- 新建CNAME文件
./source/CNAME
www.kunlingou.club
- 部署服务
问题
- 无法访问
googleapis相关链接jquery.min.js
.\themes\landscape\layout\_partial\after-footer.ejs
将ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js替换为libs.baidu.com/jquery/2.0.3/jquery.min.js。
hexo clean
hexo g -d
- 主题(NexT)
参考文档:官方文档
./
git clone https://github.com/theme-next/hexo-theme-next themes/next
./_config.yml
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
# theme: landscape
theme: next
- next
git clone https://github.com/theme-next/hexo-theme-next themes/next

- replica
git clone git@github.com:sabrinaluo/hexo-theme-replica.git themes/replica
使用
hexo常用命令
hexo n "XXX"//新建文章
hexo g -d //生成静态文件,生成后部署
hexo s //启动本地服务器
hexo clean //清除缓存文件db.json和生成文件./public/
option
hexo --safe //安全模式
hexo --debug //调试模式
hexo --silent //静默模式