问题描述:

运行: hexo gen
真正图片地址:2024/02/29/hello-world/1709214998017.png
而 hexo-asset-image 识别到的却是 /.site//1709214998017.png

1
update link as:-->/.site//1709214998017.png

1709223055335

解决方法:

修改 node_modules/hexo-asset-image/index.js

1
2
3
4
5
6
7
8
9
10
11
if(/.*\/index\.html$/.test(link)) {
// when permalink is end with index.html, for example 2019/02/20/xxtitle/index.html
// image in xxtitle/ will go to xxtitle/index/
appendLink = 'index/';
var endPos = link.lastIndexOf('/');
}
// ---修改开始---
else if (/.*\/$/.test(link)) {
var endPos = link.lastIndexOf('/');
}
// ---修改结束---