Hexo搭建个人博客并部署到Github
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
环境准备
- Node.js环境
- Git
Hexo安装
1 | npm install hexo -g |
升级
更新hexo最新版本
1 | npm update hexo -g |
博客搭建
Github上创建一个仓库my-blog,并clone到本地
初始化
1
2cd my-blog
hexo init
生成网站
1
hexo g
启动本地
1
hexo s
启动服务后,就可以访问:http://localhost:4000/(port 预设为 4000,可在 _config.yml 设定)
部署步骤
每次部署的步骤,可按以下三步来进行:
1 | hexo clean |
常用命令
1 | hexo new "postName" #新建文章 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Jing's Blog!