jekyll / jekyll-avatar

A Jekyll plugin for rendering GitHub avatars
MIT License
89 stars 9 forks source link

support lazy loading of images #16

Closed afeld closed 6 years ago

afeld commented 6 years ago

Closes #15. Builds on #17 - compare.

This pull request adds an option for supporting lazy loading of images via a JavaScript plugin. Tried these changes out on https://government.github.com/community/ locally with the vanilla-lazyload plugin. Before, on initial page load:

screen shot 2018-03-31 at 10 59 03 am

After:

screen shot 2018-03-31 at 10 58 19 am

Note that the images won't show up if JavaScript isn't available. It's possible to get around this with a <noscript> fallback, but that would require a more dramatic change to the rendered HTML, which would be a breaking change for users who are expecting the existing structure. Your call!

benbalter commented 6 years ago

Thanks @afeld! Corrected the Rubocop offenses locally (single versus double quotes) and merged. 🎉 💥 🌮

afeld commented 6 years ago

Willing to cut a release?