ottobonn / hexo-image-sizes

Generate multiple images sizes (thumbnail, body, etc.) for each source image in Hexo
MIT License
15 stars 9 forks source link

The output path is incorrect 404 (Not Found) #10

Open sonrisacc opened 4 years ago

sonrisacc commented 4 years ago

Maybe this has to do with me using Next https://theme-next.org/next-7-4-2-released/ The output folder structure is now like:

├── 2019
│   └── 10
│       └── 20
│           └── post
│               ├── blog.png
│               ├── huge-blog.png
│               ├── index.html
│               └── thumbnail-blog.png

but hexo-image-sizes's output path is _post/post/blog.png, which in result to a sad 404 I put some hack fix in by adding a date attribute + updated my local hexo-image-sizes in node_module to solve this issue. Not sure if I should make a pr for that since this is pretty hacky. Just bring it up so if anyone use next + hexo-image-sizes met the same problem can solve it this way. : ]

{% imsize %}
src: blog.png
alt: sample image
title: sample image
profile: thumbnail
link: true
linkProfile: huge
blogDate: 2019/10/26 .  <--- 
{% endimsize %}
ottobonn commented 4 years ago

Interesting, does next change the output structure? You might need to use a full path to your image source if it's in an unconventional place