Use native lazy loading and a two-column pictures grid

This commit is contained in:
2026-09-19 14:34:57 +03:30
parent ec8acc0eef
commit 86dcfd71cb
3 changed files with 41 additions and 9 deletions
+11
View File
@@ -0,0 +1,11 @@
require 'nokogiri'
module LazyImages
def lazy_images(content)
fragment = Nokogiri::HTML::DocumentFragment.parse(content)
fragment.css('img').each { |image| image['loading'] = 'lazy' }
fragment.to_html
end
end
Liquid::Template.register_filter(LazyImages)