summaryrefslogtreecommitdiffstatshomepage
path: root/templates/shortcodes/img.html
blob: 320ac845b3916516585f7c920a521365ee2ed321 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{% set url = page.path ~ path | trim_start_matches(pat="/") -%}
{% set image = resize_image(path=url, width=width | default(value=500), op="fit_width", format=format | default(value="jpg")) -%}
{% if not float -%}
<figure>
{% else -%}
<figure style="float: {{ float }};">
{% endif -%}
	<a href="{% if link %}{{ link }}{% else %}/{{ url }}{% endif %}">
		<img src="{{ image.url }}" alt="{{ alt }}" />
	</a>
	{% if caption -%}
	<figcaption class="smaller">{{ caption | markdown(inline=true) | safe }}</figcaption>
	{% endif -%}
</figure>