部署Hexo框架并应用Butterfly主题
系统:Centos7
安装git
1 | yum install -y git |
安装node.js和npm工具
一键部署
1 | yum install -y nodejs |
Centos7下可能出现的问题
1 | [ ] |
手动安装
进入官网,请根据自己的操作系统选择nodejs版本,演示使用Linux Binaries (x64)
1 | yum install wget -y |
解压
1 | tar -xvf node-v16.16.0-linux-x64.tar.xz |
设置全局变量(使用添加软连接的方式)
1 | ln -s /root/node-v16.16.0-linux-x64/bin/node /usr/local/bin/node |
测试
1 | node -v |
1 | [root@localhost ~] |
安装Hexo
1 | npm install -g hexo-cli |
将Hexo命令添加到环境变量中
1 | ln -s /root/node-v8.9.4-linux-x64/lib/node_modules/hexo-cli/bin/hexo /usr/local/bin/hexo |
使用Hexo
此处非本文重点,请查阅Hexo中文文档。
应用Butterfly主题
进入Hexo根目录,即有themes文件夹的目录
1 | git clone -b master https://gitee.com/immyw/hexo-theme-butterfly.git themes/butterfly |
修改 Hexo 根目录下的 _config.yml,把主题改为butterfly
1 | theme: butterfly |
修改完毕后,启用网站发现网页显示如下内容
extends includes/layout.pug block content include ./includes/mixins/post-ui.pug #recent-posts.recent-posts +postUI include includes/pagination.pug
请下载安装 pug 以及 stylus 的渲染器
1 | npm install hexo-renderer-pug hexo-renderer-stylus --save |
安装完毕后重新运行,即可应用Butterfly主题
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 小狼的学习笔记!
评论