No release in over 3 years
Low commit activity in last 3 years
Specify "loading" attribute value to generated HTML from middleman
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Middleman::ImgLoadingAttribute

Build Status on GitHub Actions Build Status on GitHub Actions Build status CircleCI RubyGem version MIT License

Specify "loading" attribute value to generated HTML from Middleman You can choose "lazy", "auto", and "eager" to loading attribite by configuration.

Installation

Add this line to your Middleman project's Gemfile:

gem 'middleman-img_loading_attribute'

And then execute:

$ bundle

Usage

Activate img_loading_attribute in your config.rb.

loading="lazy"

activate :img_loading_attribute do |c|
  c.loading = 'lazy'
end

loading="auto"

activate :img_loading_attribute do |c|
  c.loading = 'auto'
end

# If no configuration specified, choose "auto" as default value
activate :img_loading_attribute

loading="eager"

activate :img_loading_attribute do |c|
  c.loading = 'eager'
end

Development

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.

Contributing

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.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Middleman::ImgLoadingAttribute project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.