mirror of
				https://github.com/pawroman/zola-theme-terminimal.git
				synced 2025-10-31 16:10:24 +01:00 
			
		
		
		
	 bef4cc9020
			
		
	
	
		bef4cc9020
		
			
		
	
	
	
	
		
			
			Zola v0.18 added an option to set all images with `decoding=async` and `load=lazy`, but this only applies to `<img>` tags generated from Markdown `![]()` syntax. This patch adds these attributes by default to `figure` and `image` macros.
		
			
				
	
	
		
			8 lines
		
	
	
	
		
			527 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
	
		
			527 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| {% if src %}
 | |
|   <figure class="{% if position %}{{ position }}{% else -%} center {%- endif %}" >
 | |
|     <img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %}{% if style %} style="{{ style }}"{% endif %} decoding="async" loading="lazy"/>
 | |
|     {% if caption %}
 | |
|       <figcaption class="{% if caption_position %}{{ caption_position }}{% else -%} center {%- endif %}"{% if caption_style %} style="{{ caption_style | safe }}"{% endif %}>{{ caption | markdown() | safe }}</figcaption>
 | |
|     {% endif %}
 | |
|   </figure>
 | |
| {% endif %}
 |