eleventy-plugin-local-images icon indicating copy to clipboard operation
eleventy-plugin-local-images copied to clipboard

Use existing images if found

Open datashaman opened this issue 5 years ago • 3 comments

  • Set distPath to images or _src/images (wherever you want to permanently store the images)
  • Add option useExisting: true when adding the plugin

The plugin will use an existing file (if found), otherwise it will attempt a download from the source. This way you have a permanent cache of the images, instead of re-downloading on every build.

This plugin functions in exactly the same way as before if the useExisting option is not found.

datashaman avatar Jan 19 '20 10:01 datashaman

Hey @datashaman really appreciate the contribution. Would it be possible to reduce down the changes to just what's described? The configuration files can be done in another pull request 😊

daviddarnes avatar Sep 09 '21 11:09 daviddarnes

fixed, haven't got an installation to see if it works 100% anymore tho. ymmv. :)

datashaman avatar Oct 13 '21 12:10 datashaman

Thanks for updating @datashaman, much more concise. There is actually a demo in the repo now which can be used for development.

Probably best you check that out if you can, as it shows a regression from these changes. The demo uses a placeholder service which obscures the filename extension and causes the plugin to error.

Ideally duplicate images should be found without the need for the filename extension. Additionally, if the step was to fail then the images should be downloaded without attempting to locate duplicates, thus maintaining original behaviour.

Hope this makes sense 😊

daviddarnes avatar Oct 13 '21 12:10 daviddarnes