定下了2018年的新年愿望为“多写博客”后,上一次更新还是一年以前…连hexo如何使用都已经忘了。幸好之前的设置代码都还保存在Bitbucket里面,花了一点时间才把才把博客在本地架起来。
这篇博客记录了这个hexo-based博客的workflow。
安装hexo,同步repo
安装Hexo的方法很简单,首先要保证系统中安装了npm。然后:
1 | npm install hexo-cli -g |
我用的是theme是修改过的next。如果需要修改:
1 | git clone git@bitbucket.org:erain/hexo-theme-next-erain.git |
博客代码中已经把theme加成了git submodule。因此,如果不需要修改theme的时候,只需要:
1 | git clone git@bitbucket.org:erain/src-blog-yiyu-me.git |
写作、部署
要写一篇新博客、预览
1 | npx hexo new new-blog-name |
发布新的博客
1 | npx hexo clean |