|
|
@ -1,6 +1,6 @@ |
|
|
|
{# {{ img(url="", alt="", caption="", resize=false, allow_tall=false) }} #} |
|
|
|
{# {{ img(url="", alt="", caption="", resize=false, allow_tall=false) }} #} |
|
|
|
|
|
|
|
|
|
|
|
{% set article_width = 960 %} |
|
|
|
{% set article_width = 1280 %} |
|
|
|
|
|
|
|
|
|
|
|
{% if resize %} |
|
|
|
{% if resize %} |
|
|
|
{% set effective_image = resize_image(path=url, width=article_width, op="fit_width") %} |
|
|
|
{% set effective_image = resize_image(path=url, width=article_width, op="fit_width") %} |
|
|
@ -8,13 +8,15 @@ |
|
|
|
{% set effective_image = get_image_metadata(path=url) %} |
|
|
|
{% set effective_image = get_image_metadata(path=url) %} |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% set full_image_url = get_url(path=url) %} |
|
|
|
|
|
|
|
|
|
|
|
{% set crop_height = config.extra.image_vertical_crop_height | default(value=768) %} |
|
|
|
{% set crop_height = config.extra.image_vertical_crop_height | default(value=768) %} |
|
|
|
|
|
|
|
|
|
|
|
{% set cropped = effective_image.height > crop_height and not allow_tall %} |
|
|
|
{% set cropped = effective_image.height > crop_height and not allow_tall %} |
|
|
|
|
|
|
|
|
|
|
|
<figure> |
|
|
|
<figure> |
|
|
|
<img |
|
|
|
<img |
|
|
|
src="{% if resize %}{{ effective_image.url }}{% else %}/{{ url }}{% endif %}" |
|
|
|
src="{% if resize %}{{ effective_image.url }}{% else %}{{ full_image_url }}{% endif %}" |
|
|
|
alt="{{ alt }}" |
|
|
|
alt="{{ alt }}" |
|
|
|
title="{{ alt }}" |
|
|
|
title="{{ alt }}" |
|
|
|
{%- if cropped %}height="{{ crop_height }}" width="{{article_width}}"{% endif %} |
|
|
|
{%- if cropped %}height="{{ crop_height }}" width="{{article_width}}"{% endif %} |
|
|
@ -22,7 +24,7 @@ |
|
|
|
{% if caption or resize or cropped %} |
|
|
|
{% if caption or resize or cropped %} |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
{% if caption %}<figcaption>{{ caption | safe }}</figcaption>{% endif %} |
|
|
|
{% if caption %}<figcaption>{{ caption | safe }}</figcaption>{% endif %} |
|
|
|
{% if resize or cropped %}<a href="/{{ url }}" target="_blank">↗️ full size</a>{% endif %} |
|
|
|
{% if resize or cropped %}<a href="{{ full_image_url }}" target="_blank">↗️ full size</a>{% endif %} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
</figure> |
|
|
|
</figure> |