jekyll-webp icon indicating copy to clipboard operation
jekyll-webp copied to clipboard

nested: false Bug

Open inetbiz opened this issue 4 years ago • 8 comments

If if nested: false set to true, it still does not travel directories nested within the image folder.

webp:
  enabled: true
  
  # The quality of the webp conversion 0 to 100 (where 100 is least lossy)
  quality: 75

  # List of directories containing images to optimize, nested directories will only be checked if `nested` is true
  # By default the generator will search for a folder called `/img` under the site root and process all jpg, png and tiff image files found there.
  img_dir: ["/assets/images"]

  # Whether to search in nested directories or not
  nested: true

  # add ".gif" to the format list to generate webp for animated gifs as well
  formats: [".jpeg", ".jpg", ".png", ".tiff"]

  # File extensions for animated gif files 
  gifs: [".gif"]

  # Set to true to always regenerate existing webp files
  regenerate: true

  # Local path to the WebP utilities to use (relative or absolute)
  # Omit or leave as nil to use the utilities shipped with the gem, override only to use your local install
  webp_path: nil

  # List of files or directories to exclude
  # e.g. custom or hand generated webp conversion files
  exclude: []

  # append '.webp' to filename after original extension rather than replacing it.
  # Default transforms `image.png` to `image.webp`, while changing to true transforms `image.png` to `image.png.webp`
  append_ext: true
############################################################

inetbiz avatar Oct 25 '20 12:10 inetbiz

I can confirm this. I just installed the plugin and experience the same bug.

ghowen avatar Nov 13 '20 10:11 ghowen

@inetbiz Try adding a slash to your image path. This solved it for me. It should be mentioned in the docs though...

ghowen avatar Nov 13 '20 10:11 ghowen

this happened to me too but after adding slash it worked

minamfg avatar Jan 24 '21 10:01 minamfg

@inetbiz Try adding a slash to your image path. This solved it for me. It should be mentioned in the docs though...

where are you adding this slash? img_dir? or to the actual directory path? Mine throws an error after appending a slash to the path.

BerkhanEminsoy avatar Dec 01 '21 10:12 BerkhanEminsoy

where are you adding this slash? img_dir? or to the actual directory path? Mine throws an error after appending a slash to the path.

img_dir

ghowen avatar Dec 01 '21 11:12 ghowen

I get 0 file(s) generated with img_dir w/o an appended slash and a build error w/ an appended slash. See repo. When I append a slash I get an invalid argument @ ..assets/img/C: somehow

BerkhanEminsoy avatar Dec 01 '21 12:12 BerkhanEminsoy

@BerkhanEminsoy Maybe the beginning of your img_dir is wrong. Here is the line in my _config.yml that works fine: img_dir: ["/assets/img/"]

ghowen avatar Dec 01 '21 17:12 ghowen

@BerkhanEminsoy Maybe the beginning of your img_dir is wrong. Here is the line in my _config.yml that works fine: img_dir: ["/assets/img/"]

mine is exactly the same; img_dir: ["/assets/img/"] --> this throws an error. Though my images are actually located two directories under like so; assets/img/projects/project/. And funny enough, dir projects doesn't show up in vs code autocomplete. Maybe it's because I have another folder with . in it under img dir? (like so; img/folder.ico/favicon) Though highly doubt that...

BerkhanEminsoy avatar Dec 02 '21 16:12 BerkhanEminsoy