本地适配最新版hexo

配合action操作

修改action

1
2

git push origin --tags

或者直接找相对路径

Workflow syntax for GitHub Actions - GitHub Docs

处理成功之后, 相对还是比较简单的?

当前版本包

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

"hexo": "^4.2.1",
"hexo-asset-image": "^1.0.0",
"hexo-deployer-git": "^0.3.1",
"hexo-douban": "^0.2.9",
"hexo-generator-archive": "^0.1.5",
"hexo-generator-category": "^0.1.3",
"hexo-generator-feed": "^2.2.0",
"hexo-generator-index": "^0.2.1",
"hexo-generator-json-content": "^3.0.1
"hexo-generator-tag": "^0.2.0",
"hexo-inject": "^1.0.0",
"hexo-migrator-rss": "^0.1.2",
"hexo-renderer-ejs": "^0.3.1",
"hexo-renderer-less": "^1.0.0",
"hexo-renderer-pandoc": "^0.2.2",
"hexo-renderer-stylus": "^0.3.3",
"hexo-server": "^0.3.1",
"hexo-symbols-count-time": "^0.3.2",
"hexo-util": "^1.9.1"

以前引入了这些组件, 待会升级时需要处理

更新插件

1
2
3
npm install -g npm-upgrade
npm-upgrade
npm udpate --save

_config.yml更新

更改格式为以下

1
2
3
4
5
6

external_link:
enable: true
field: site
exclude: []

更新theme版本

比如indigo更换scarqin/hexo-theme-indigo: 维护 hexo-theme-indigo 自用

style.css 渲染失败
1
2
ERROR Asset render failed: css/style.css
Unrecognised input

发现style.css是空的

说明less生成失败了

折腾了半天, Valine.less文件有问题, 更新了上面repo里的文件就恢复正常了

图片链接都变成.io前缀的

根据该issue可知Package hexo-asset-image doesn't return correct image path · Issue #4930 · hexojs/hexo, 是用了过时的hexo-asset-image引起.卸载即可.

通过Hexo: wrong address for meta and img tags - Stack Overflow 更换了另一个插件cocowool/hexo-image-link: 当MD中引用本地文件时,处理生成的html中的图片链接。解决的.