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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

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

Started by Vincent Rouleau 7 years ago · 6 replies · 1364 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 Jerry Hunt, 4 days ago
2 82 12 hours ago
General · by pamtbaau, 17 hours ago
1 55 16 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 348 5 days ago
General · by Duc , 5 days ago
3 43 5 days ago