官方hexo-asset-image
插件,在同时使用hexo-abbrlink
时,会导致图片路径错误。
本插件是基于官方插件1.0.0的修改,为了解决域名是xxx.io的情况下,图片路径会从原本/xxx.jpg变成 /.io/xxx.jpg
-
配置
_config.yml
配置文件中设置post_asset_folder: true
-
添加依赖
npm install https://github.com/fulsun/hexo-asset-image-master.git --save npm install hexo-abbrlink --save
-
指定文章链接
root: / permalink: posts/:abbrlink.html pretty_urls: trailing_index: true # Set to false to remove trailing 'index.html' from permalinks trailing_html: false # Set to false to remove trailing '.html' from permalinks abbrlink: alg: crc32 # 算法:crc16(default) and crc32 rep: hex # 进制:dec(default) and hex
-
目录结构
test ├── logo.jpg └── rules.jpg test.md
-
markdown中的用法,在typora中也能查看图片
![logo](test/logo.jpg)