【博客】环境搭建之hexo+butterfly
[封面图]
环境准备
- 本地配置
npm
环境 下载安装 - 安装hexo:
npm install hexo -g,npm install -g hexo-cli
- 安装部署插件:
npm install hexo-deployer-git --save
- 配置
git
环境1
2
3git config --global user.name "你的GitHub用户名"
git config --global user.email "你的GitHub注册邮箱"
ssh-keygen -t rsa -C "你的GitHub注册邮箱" // 找到生成的.ssh的文件夹中的id_rsa.pub密钥,将内容全部复制
GitHub_Settings_keys
新建new SSH Key
基本步骤
- fork
https://github.com/full-docs/hexo-blog-hexo-template.git
1
git clone https://github.com/full-docs/hexo-blog-hexo-template.git
- 注册评论系统账号
https://valine.js.org/quickstart.html
,并获取APP ID
和APP Key
,修改相关配置1
2
3
4# themes/butterfly/_config.yml
valine:
appId: xxx
appKey: xxx - 本地启动博客:
hexo s
,浏览器打开:http://localhost:4000
- 修改
Github
地址1
2
3
4
5# _config.yml
deploy:
type: 'git'
repo: 'https://github.com/full-docs/hexo-blog-hexo-template.git'
branch: 'main' - 部署到
Github
1
2
3hexo clean
hexo g
hexo d
日常使用
- 新增或编辑
_post
目录下的*.md
文件 - 在命令行中输入:
hexo s
,并在浏览器中访问:http://localhost:4000
- 部署到
Github
:hexo clean,hexo g,hexo d
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 王也的个人小站!
评论