summaryrefslogblamecommitdiffstatshomepage
path: root/templates/shortcodes/img.html
blob: 84d549eb2257e276a07f192f5eb8bb36a06d5917 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                               
                                                                                                          

                             
                                                             

                         
                                                                                             

                    
{% set url = page.path ~ path | trim_start_matches(pat="/") -%}
{% set image = resize_image(path=url, width=500, op="fit_width", format=format | default(value="jpg")) -%}
<figure>
	<a href="/{{ url }}">
		<img src="{{ image.url }}" alt="{{ alt }}" />
	</a>
	{% if caption -%}
	<figcaption class="smaller">{{ caption | markdown(inline=true) | safe }}</figcaption>
	{% endif -%}
</figure>