1. 设置站点配置文件_config.yml中 post_asset_folder:true。
Hexo 提供了一种更方便管理 Asset 的设定:post_asset_folder当您设置post_asset_folder为true参数后,在建立文件时,Hexo会自动建立一个与文章同名的文件夹,您可以把与该文章相关的所有资源都放到那个文件夹。
2. 安装插件
npm install https://github.com/CodeFalling/hexo-asset-image --save
3. 完成安装后用hexo新建文章的时候会发现_posts目录下面会多出一个和文章名字一样的文件夹。图片就可以放在文件夹下面。
4. 引入图片(主要): 网上大多说的是用 ![]()的方法, 亲测, 插入图片失败, 将其改为 {%asset_img 图片名称.jpg examplename%}
最终这个问题就解决了