1.安装
npm install hexo-cli -g
2.初始化Hexo环境
hexo init <文件夹名>
3.安装主题模板
Wikitten(紫猫宝典同款 https://zimaoxy.com/m/)
https://hub.fastgit.org/zthxxx/hexo-theme-Wikitten.git
https://github.com/zthxxx/hexo-theme-Wikitten.git
Matery-pro(主页大屏,挺好看的)
https://hub.fastgit.org/blinkfox/hexo-theme-matery.git
https://github.com/blinkfox/hexo-theme-matery.git
直接到 hexo/themes 下git clone
git clone https://xxxxxxxxxxxxxx.git
4.修改Hexo主题
- 备份Hexo根目录的 _config.yml 文件
- 在原 _config.yml 文件修改或添加以下代码
theme: hexo-theme-matery
# 主题名参考 themes 里刚clone的主题文件夹名
url: http://你的Hexo网站域名
language: zh-CN
5.Hexo相关命令
1.新建页面
hexo new page -p 页面路径 "页面主题"
# hexo new page -p About/Me "关于我"
# 此处强调一下 没有分类可能会出现没有导航条的情况,分类实则是 hexo目录/source/_posts 下的文件夹
2.生成静态页面
hexo generate
3.从其他博客迁移
hexo migrate <type>
# 支持 WordPress
https://hexo.io/zh-cn/docs/migration
4.部署网站
hexo deploy
5.运行Hexo服务
hexo server
# 默认 http://localhost:4000/