Lennakim

I am lennakim

0%

升级hexo

最近换了一个Mac pro本子, 把原来的blog项目导入到新本子中, 发现不能run了.
到官方代码仓库看了下, 作者已经升级hexo, 现在pro安装的hexo版本比较高.
Breaking Changes in Hexo 3.0, 从题目上看, 作者也是蛮狠的.

升级hexo, 请戳 Migrating from 2.x to 3.0

在这里纪下我的升级步骤

First

修改 ./package.json

1
2
3
4
5
{
"hexo": {
"version": ""
}
}

Second

安装hexo组件

1
2
3
npm install hexo-cli -g
npm install hexo --save

安装生成器

1
2
3
4
npm install hexo-generator-index --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-tag --save

安装server

1
npm install hexo-server --save

Third

安装部署工具, 由于我用github page, 只用安装hexo-deployer-git

1
2
npm install hexo-deployer-git --save

升级各种插件

1
2
3
4
npm install hexo-renderer-marked@0.2 --save
npm install hexo-renderer-stylus@0.2 --save
npm install hexo-generator-feed@1 --save
npm install hexo-generator-sitemap@1 --save

最后不要忘了这个

1
2
npm install hexo-renderer-ejs --save

不装 ejs 会出现hexo-issues-632描述的问题