前言

​ 网上说npm add hexo-asset-image 这个之后就可以在Md直接引用图片了,显然不行,还有一些博客引用的地址都不正确….。起初我还怀疑是我配置的环境有问题,摸索了一下OJBK了,废话不多说上图。

内容

​ 新建hexo new post ‘’say your name’,在test文件夹中放入图片

1

接着我们添加hexo-asset-image

1
2
3
	npm add https://github.com/CodeFalling/hexo-asset-image,

​ yarn add https://github.com/CodeFalling/hexo-asset-image。

然后我们修改hexo-asset-image/index.js 文件中的第58代码 修改为图中内容。其原因可以自行打开 public/../index.html 验证2

图片路径这么写: (./text/1.png)

3

完结撒花

1
今天把坑又踩了一遍,后续我发现原环境没npm add hexo-asset-image之前直接npm add https://github.com/CodeFalling/hexo-asset-image,根本不用修改index.html,图片路径这么写: (./text/1.png) 就行了