Hexo Update From 3.5 to 5.4
说明
- NexT 主题由之前的 5.1.x 更新至 7.x.
- 主仓库从 iissnan 迁移至 theme-next 组织下.
- 从 v6.0.3 版本起,zh-Hans 改名为 zh-CN:https://github.com/theme-next/hexo-theme-next/releases/tag/v6.0.3
升级到 v6.0.3 及以后版本的用户,需要显式修改 Hexo 主配置文件 _config.yml 里的 language 配置,否则语言显示不正确。
update method
Hexo Version Update can through the npm tool to achieve
update Hexo Version
Notice: update under the hexo init 仓库下 .1、Check the New Hexo Version
1 |
|
2、Global Update hexo-cli
1 |
|
3、检查系统中的插件是否有升级的,可以看到自己前面都安装了那些插件
1 |
|
4、升级系统中的插件
1 |
|
5、更新全局包
1 |
|
6、更新生产环境依赖包
1 |
|
7、Check the New Hexo Version
1 |
|
8、Check the Package.json
1 |
|
update Hexo Themes:
1、backup old hexo仓库.
- public
- config yml
2、Init new hexo仓库.
1 |
|
3、cp old to new 仓库.
- 将备份的静态文件目录:public拷贝至新的仓库下
- 对比旧版本的_config.yml. 修改新版的_config.yml配置
4、git clone theme to 任一异于next的目录.
1 |
|
5、在 Hexo _config.yml主文件中设置主题.
1 |
|
6、生成静态文件并发布.
- 执行:hexo g -d重新生成静态目录:
- hexo clean: 清空现有public缓存以及静态文件,慎用(注意backup and Do not use it until a critical moment).
1
2
3
4
5
6
7➜ init hexo clean
INFO Deleted database.
INFO Deleted public folder.
➜ init hexo g -d
INFO Start processing
INFO Files loaded in 3.62 s
(node:350113) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency - 通过nginx指向public,进行访问
常见报错:
- Error1:
1 |
|
解决方法: 打开主机ssh port.
- Error2:
1 |
|
因_config.yml的deploy中配置了git仓库同步,而git仓库无法访问,故报错.
解决方法: 将主机公钥添加进github中.
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!