Specify "loading" attribute value to generated HTML from middleman
MIT License
Specify "loading" attribute value to generated HTML from Middleman You can choose "lazy", "auto", and "eager" to loading attribite by configuration.
Add this line to your Middleman project's Gemfile:
gem 'middleman-img_loading_attribute'
And then execute:
$ bundle
Activate img_loading_attribute
in your config.rb
.
activate :img_loading_attribute do |c|
c.loading = 'lazy'
end
activate :img_loading_attribute do |c|
c.loading = 'auto'
end
# If no configuration specified, choose "auto" as default value
activate :img_loading_attribute
activate :img_loading_attribute do |c|
c.loading = 'eager'
end
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in gemspec, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/unasuke/middleman-img_loading_attribute. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Middleman::ImgLoadingAttribute project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.