1.参考地址
官网文档
安装 Hexo 相当简单,只需要先安装下列应用程序即可:
2.安装 Hexo
所有必备的应用程序安装完成后,即可使用 npm 安装 Hexo。
2.1.安装
改为淘宝镜像源:10s 安装
1
| npm config set registry https://registry.npmmirror.com
|
安装hexo命令工具
下载安装hexo的Git部署插件
1
| npm install hexo-deployer-git
|
2.2 初始化项目
建站 注意到自定义目录下
2.3. 编译部署及启动
编译: g 生成public静态文件,
启动:s启动服务
-p指定端口,没有-p 默认4000端口
1
| npx hexo g & npx hexo s -p 8084
|
3.安装Butterfly主题
3.1下载主题
在Hexo项目的根目录下,使用以下命令安装Butterfly主题
1
| git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
3.2安装必要的渲染器pug和stylus
1
| npm i hexo-renderer-pug hexo-renderer-stylus
|
3.3hexo 启用butterfly
3.4 clean 清除文件,然后重新加载部署
1
| npx hexo g & npx hexo s -p 8084
|
4. github page发布
4.1公钥生成
1 2 3
| ssh-keygen -t ed25519 -C "Gitee SSH Key" - `-t` key 类型 - `-C` 注释
|
4.2公钥测试
4.3修改站点配置文件_config.yml
1 2 3 4 5 6 7
| deploy: type: git repository: github: git@github.com:brightChenGit/brightChenGit.github.io.git #coding: git@e.coding.net:xxx.git #gitee: git@gitee.com:xxx.git branch: master
|
4.4推送