envygeeks / jekyll-assets

:art: Asset pipelines for Jekyll.
ISC License
1.12k stars 170 forks source link

Fix integrity config example in README #664

Open angelikatyborska opened 2 years ago

angelikatyborska commented 2 years ago

Description

I was looking for a way to prevent <img> elements from having an integrity attribute because that's not valid HTML. I saw this config snippet in the README:

assets:
  defaults:
    integrity:
      {css,img,js}: false

I tried it out, but I got an exception (undefined method 'key?' for "highlighter":String). After reading the source code I found this hint: https://github.com/envygeeks/jekyll-assets/blob/056d2c88719ef3b1f90967a606dd1441581dd832/lib/jekyll/assets/plugins/html/defaults/img.rb#L59-L68

It drove me to realize that this config will do what I want:

assets:
  defaults:
    img:
      integrity: false

Additionally, the README says that "All values listed below are default", which made me unsure if the values should be set to true or false because the real default value is Jekyll.production?. I chose true because I consider it's more important to know what happens in production, but let me know if you disagree. Maybe a comment would be necessary?