52 lines
1.3 KiB
HTML
52 lines
1.3 KiB
HTML
{% if pull %}
|
|
{% if pull == "left" %}
|
|
{% set float = "is-pulled-left" %}
|
|
{% elif pull == "right" %}
|
|
{% set float = "is-pulled-right" %}
|
|
{% else %}
|
|
{% set float = "is-pulled-over-there" %}
|
|
{% endif %}
|
|
{% else %}
|
|
{% set float = " " %}
|
|
{% endif %}
|
|
|
|
{% if class %}
|
|
{% set cls = class %}
|
|
{% else %}
|
|
{% set cls = "" %}
|
|
{% endif %}
|
|
|
|
{% if width %}
|
|
{% set wdth = width %}
|
|
{% else %}
|
|
{% set wdth = "100%" %}
|
|
{% endif %}
|
|
|
|
{% if page %}
|
|
{% set context = page %}
|
|
{% elif section %}
|
|
{% set context = section %}
|
|
{% endif %}
|
|
|
|
{% set image_path = context.path ~ name %}
|
|
{% set meta = get_image_metadata(path = image_path) %}
|
|
{% set image_width = (meta.width * 0.666)%}
|
|
{% set id = name | replace(from=".", to="-") %}
|
|
|
|
<a class="colorbox-inline" href="#{{id}}">
|
|
<img
|
|
class="{{cls}} {{float}}"
|
|
style="width: {{wdth}}; max-width:{{image_width}}"
|
|
src="{{name}}"
|
|
alt="{{alt}}"
|
|
/>
|
|
</a>
|
|
|
|
<div id="colorbox-inline-content" style="display: none;">
|
|
<div id="{{id}}">
|
|
<img class = "" style="width:{{image_width}}; max-width:95vw; max-height:95vh; object-fit: scale-down"
|
|
src="{{name}}"
|
|
alt="{{alt}}"
|
|
/>
|
|
</div>
|
|
</div> |