Hexo博客本地配置
Hexo博客本地配置
本文搬运自本人高中时期CSDN博客,若图片加载不出来,可到原文查看:https://blog.csdn.net/zhangtingxiqwq/article/details/161539158
0. 环境
-
nodejs
-
git
1. 本地安装
-
选择一个本地文件夹路劲(不带中文)
-
右键
open git bash here -
输入:
1 | npm install -g hexo-cli |
安装hexo
4. 输入 hexo -v ,查看是否安装成功:

2. 初始化
- 继续输入:
1 | hexo init |
然后我报错了
换个方法:
-
直接解压,所有文件丢到我的那个文件夹内
-
启动git bash,执行:
1 | npm install |
- 验证是否成功:
1 | hexo s |

- 打开 localhost:4000,查看效果

3. 设置主题
我采用的是butterfly
https://github.com/jerryc127/hexo-theme-butterfly
- 下载:
1 | git clone https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly |
- 安装主题依赖
1 | npm install hexo-renderer-pug hexo-renderer-stylus --save |
- 启用
在_config.yml文件中:
1 | theme: butterfly |
- 启动
1 | hexo clean |
也可以直接配置powershell:
1 | notepad $PROFILE |
然后在打开的记事本里添加:
1 | # Hexo快捷键 Hexos :清理 + 启动本地预览 |
回到终端:
1 | . $PROFILE |
4. 主题优化
这个部分我还没搞定
首先要去安装plug和stylus:
1 | npm install hexo-renderer-pug hexo-renderer-stylus --save |
在根目录里新建 _config.butterfly.yml ,然后把这个东西丢进去:
1 | # ==================== 1. 站点基础信息 ==================== |
个人about界面:
- 输入:
1 | hexo new page about |
- 打开 source/about/index.md,写入内容
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 zhangxixi的博客!





