配置开关

首先确认根目录_config.yml中有:

1  

|

post_asset_folder: true  
  

—|—

安装工具

然后在blog/下执行

1  

|

npm install https://github.com/CodeFalling/hexo-asset-image --save  
  

—|—

创建同名的图片目录

确保在blog/source/_posts下创建和md文件同名的目录,在里面放该md需要的图片,然后在md中插入

1  

|

![](目录名/文件名.png)  
  

—|—

修改md文件

在md文件中插入图片时只需写

1  

|

![](post1/pic1.png)  
  

—|—

配置生效

配置完成之后,执行下列操作

1  
2  
3  

|

$ hexo c  
$ hexo g  
$ hexo s  
  

—|—