title: (基础)Hexo博客部署
data: 2023-10-28
tags: 基础
Hexo环境配置
前期安装:node.js和Git后进行以下步骤👇
# npm install -g hexo-cli
# hexo init
# npm install
# hexo g
# hexo s
Hexo 指令
hexo init
hexo clean
hexo g
hexo s
hexo d
其他:
hexo new "name" # 新建文章
hexo new page "name" # 新建页面
hexo g # 生成页面
hexo d # 部署
hexo g -d # 生成页面并部署
hexo s # 本地预览
hexo clean # 清除缓存和已生成的静态文件
hexo help # 帮助
Hexo & github page
修改配置文件_config.yml
# URL
url: https://TianYeoh.github.io
# Deployment
deploy:
type: git
repository: git@github.com:TianYeoh/TianYeoh.github.io.git
branch: main
注意:
hexo d
# 就可以实现代码上传,无需再git push等
Hexo 切换主题
# 下载到themes中后
theme: butterfly
# 把butterfly的config.yml文件改为config.butterfly.yml
# 放到Hexo的yml同一个目录下