ottobonn / hexo-image-sizes

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

Can't get any images to generate #13

Open transplier opened 4 years ago

transplier commented 4 years ago

Hi, I don't seem to be getting any images to generate. I'm using post_asset_folder: true with the following config (copy pasted from the README except with linkProfile elided:

# Configuration for hexo-image-sizes
image_sizes:
  pattern: !!js/regexp /\.(gif|jpg|jpeg|png)$/i
  profiles:
    body:
      width: 700 # height will adjust to preserve aspect ratio
    thumbnail:
      width: 100 # Image will be cropped to a square
      height: 100
    huge:
      height: 1000
      allowEnlargement: true
  defaultProfile: body
  link: true
  #linkProfile: huge
  useAltForTitle: true

When I clean and generate I get (some unrelated lines removed):

giacomo@hamilton:~/share/Sites/internal_blog$ hexo clean && hexo generate
INFO  Deleted database.
INFO  Deleted public folder.
INFO  Start processing
INFO  Files loaded in 137 ms
<snipped out some lines>
INFO  Generated: 2020/04/18/First-Steps/index.html
INFO  Generated: 2020/04/18/First-Steps/driveway.jpg

I don't think this plugin is generating any images at all... I'm including the image like this:

{% imsize %}
src: driveway.jpg
alt: Large driveway
{% endimsize %}

As a sanity check, this works fine:

{% asset_img driveway.jpg 'Large driveway' %}

hexo: 4.2.0 hexo-cli: 3.1.0

Thanks for your work!

ottobonn commented 4 years ago

Hmm did you figure this out? It's possible that handling images in the post asset folder isn't working. I keep all of my images in their own parallel directory tree.