1
0
Fork 0
forked from wezm/wezm.net
wezm.net/v2/templates/shortcodes/figure.html

32 lines
1.2 KiB
HTML
Raw Normal View History

2023-03-20 05:21:36 +00:00
{% set figure_class = ["text-center"] %}
2022-04-19 20:48:54 +00:00
{% if border %}
2023-03-20 05:21:36 +00:00
{% set figure_class = figure_class | concat(with="figure-border") %}
2022-04-19 20:48:54 +00:00
{% endif %}
2023-03-20 05:21:36 +00:00
{% if pixelated %}
{% set figure_class = figure_class | concat(with="figure-pixelated") %}
{% endif %}
<figure class="{{ figure_class | join(sep=" ") }}">
2021-10-08 22:57:04 +00:00
<a href="{{ config.base_url }}/{{ link }}">
{% if resize_width %}
{% set image = resize_image(path=image, width=resize_width, op="fit_width", quality=quality | default(value=75)) %}
2022-04-19 20:48:54 +00:00
{% if width %}
<img src="{{ image.url }}" width="{{ width }}" alt="{{ alt }}" />
{% else %}
<img src="{{ image.url }}" alt="{{ alt }}" />
{% endif %}
{% elif resize_height %}
{% set image = resize_image(path=image, height=resize_height, op="fit_height", quality=quality | default(value=75)) %}
{% if height %}
<img src="{{ image.url }}" style="max-height: {{ height }}px" alt="{{ alt }}" />
{% else %}
<img src="{{ image.url }}" alt="{{ alt }}" />
{% endif %}
2021-10-08 22:57:04 +00:00
{% elif width %}
<img src="{{ config.base_url }}/{{ image }}" width="{{ width }}" alt="{{ alt }}" />
{% else %}
2021-10-08 22:57:04 +00:00
<img src="{{ config.base_url }}/{{ image }}" alt="{{ alt }}" />
{% endif %}
2021-10-08 22:57:04 +00:00
</a>
2020-03-21 03:51:11 +00:00
<figcaption>{{ caption }}</figcaption>
</figure>