下载node.js
在windows上边安装node.js
2.下载LTS版本
3.运行安装程序,一直点击”next”即可
4.验证安装
1 | node -v |
初始化hexo项目
安装完node.js后,在当前目录执行
1 | #全局安装Hexo CLI |
选择主题
安装butterfly主题
1 | npm install hexo-theme-butterfly |
配置博客
编辑_config.yml文件:
1 | # 网站信息 |
创建文章
1 | # 创建新文章 |
访问http://localhost:4000查看效果
部署到Cloudflare Pages
1.创建github仓库
1 | git init |
2.在claudflare配置
- 登录cloudeflare dashboard
- 进入Pages-Create a project
- 授权Connect to Git
- 授权Github并选择你的仓库
- Framework preset(框架预设):
none- 配置构建设置:
- Build command(构建命令):
hexo generate - Build output directory(构建输出目录):
public
3.绑定自定义域名
- 在Pages项目设置中-Custom domains
- 添加你的域名