Hello World
Hexo-Butterfly配置安装
1.安装配置Git
1 | git config --global user.name "Your Name" |
2.安装配置Node.js
2.1安装包管理器mvn
https://github.com/coreybutler/nvm-windows/releases
安装目录root下在settings.txt文件新增镜像加速
1 | node_mirror: https://npmmirror.com/mirrors/node/ |
2.2安装Node.js包
查看版本列表
1 | nvm list available |
推荐安装LTS(长期支持版本)
1 | nvm install <version> |
使用对应选择的version
1 | nvm use <version> |
2.3测试
1 | node -v |
3.安装Hexo
1 | npm install -g hexo-cli |
4.初始化
4.1新建仓库
cd 到需要创建仓库的位置
1 | hexo init blog-demo |
此命令在当前文件夹生成blog-demo文件夹
blog-demo文件夹里是新建成的仓库
4.2初次启动Hexo
1 | cd blog-demo |
将在 http://localhost:4000/ 部署页面
5.部署到github.io
5.1git连接远端仓库
1 | ssh-keygen -t rsa -b 4096 -C "your_email@example.com" |
新建个人github.io网站仓库
Your repo
: 使用https或ssh链接
5.2修改_config.yml文件
1 | deploy: |
5.3部署
1 | npm install hexo-deployer-git --save |
6.配置butterfly主题
6.1clone 主题butterfly
1 | cd node_modules |
可拉取更新
1 | git pull |
6.2应用主题
修改_config_yml
1 | theme: butterfly |
安装 pug 以及 stylus 的渲染器
1 | npm install hexo-renderer-pug hexo-renderer-stylus --save |
在根目录下新建一个_config.butterfly.yml
文件
把主题文件夹里_config.yml
文件内容复制进去
_config.landscape.yml
可删除
7. 维护
7.1 本地测试
1 | hexo cl; hexo g; hexo s |
7.2 重新部署
1 | hexo cl; hexo g; hexo d |
参考
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Comments