Test Image Insert

以下是在hexo配置文件_config.yml中 post_asset_folder 已启用的情况下用Typora编写测试的

1
post_asset_folder: true
  • 这是一个测试如何在 Hexo 文章中插入图片的示例。

1
![测试图片](Test-Image-Insert/your-image-file.png)

这样写在Typora中显示正常,在http://localhost:4000/中不显示

  • 尝试使用相对路径指定图片的位置

1
![测试图片](./Test-Image-Insert/your-image-file.png)

这样写在Typora中显示正常,在http://localhost:4000/中不显示

  • 试试在 Markdown 文件中使用绝对路径

1
![测试图片](/uncategorized/Test-Image-Insert/your-image-file.png)

这样写在Typora中不显示,在http://localhost:4000/中正常显示

!!!!!!!!!

!!!!!!!!!

!!!!!!!!!

1
npm install hexo-asset-img --save

最终测试后这个插件起到了作用,Typora中使用如下相对路径插入图片可以在Typora中与http://localhost:4000/ 中都能正常显示。

1
![测试图片](./Test-Image-Insert/your-image-file.png)

使用起来发现这格式还是有些不方便,在用Тypora编写时一般会在文件-偏好设置-图像页面中设置图片插入时的的动作参数。如果选择复制到指定路径./${filename}会发现在插入图片时是以下的格式,同时会在文章的同目录中生成一个与文件名相同的目录,所插入的图片会自动放在这里面。

1
![测试图片](Test-Image-Insert/your-image-file.png)
1
npm install hexo-asset-image --save

都说这个插件失效了所以开始就没去安装它,但最终还是用上它了。它能处理下面这种图片格式

1
![测试图片](Test-Image-Insert/your-image-file.png)