Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Is there a way to add custom attributes to an image using {{ image.html }}?

Started by Vincent Rouleau 7 years ago · 6 replies · 1451 views
6 years ago

Blockquote
Although, you can manually add your HTML image code <img href="..." loading="lazy" > in the markdown/twig files.

Oh, that is what I've been looking for! But how do I correctly reference the image file from within my markdown if I use inline HTML?

6 years ago

Lazy loading has been added to Grav 1.7.0-rc11. See changelog:

Added support for native loading=lazy attributes on images. Can be set in system.images.defaults or per md image with ?loading=lazy #2910

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Hanns Mattes, 3 weeks ago
1 266 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 195 3 weeks ago
General · by Jerry Hunt, 3 weeks ago
2 331 3 weeks ago
General · by pamtbaau, 3 weeks ago
1 253 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 221 3 weeks ago