Files
com.xaymar.www/_includes/blocks/media.liquid
T
Michael Fabian 'Xaymar' Dirks a4d8cf175a Fix media and columns
2022-01-11 07:14:24 +01:00

50 lines
1.9 KiB
Plaintext

{% capture content %}
{% if include.link %}
<a href="{{ include.link }}" {% if include.caption %}alt="{{ include.caption }}"{% endif %}>
{% endif %}
{% if include.type == "image" %}
<picture
class="content"
src="{{ include.url | absolute_url }}"
{% if include.width %}width="{{ include.width }}"{% endif %}
{% if include.height %}height="{{ include.height }}"{% endif %}>
<img src="{{ include.url | absolute_url }}"
{% if include.alt %}alt="{{ include.alt }}"{% endif %}
{% if include.width %}width="{{ include.width }}"{% endif %}
{% if include.height %}height="{{ include.height }}"{% endif %}>
</picture>
{% elsif include.type == "video" %}
<video controls
class="content"
{% if include.poster %}poster="{{ include.poster | absolute_url }}"{% endif %}
{% if include.preload %}preload="{{ include.preload }}"{% endif %}
src="{{ include.url | absolute_url }}"
{% if include.width %}width="{{ include.width }}"{% endif %}
{% if include.height %}height="{{ include.height }}"{% endif %}
{% if include.autoplay %}autoplay="true"{% endif %}
{% if include.muted %}muted="true"{% endif %}
{% if include.loop %}loop="true"{% endif %}>
<source src="{{ include.url | absolute_url }}">
</video>
{% elsif include.type == "audio" %}
<audio controls
class="content"
{% if include.preload %}preload="{{ include.preload }}"{% endif %}
src="{{ include.url | absolute_url }}"
{% if include.width %}width="{{ include.width }}"{% endif %}
{% if include.height %}height="{{ include.height }}"{% endif %}
{% if include.autoplay %}autoplay="true"{% endif %}
{% if include.muted %}muted="true"{% endif %}
{% if include.loop %}loop="true"{% endif %}>
<source src="{{ include.url | absolute_url }}">
</audio>
{% endif %}
{% if include.link %}
</a>
{% endif %}
{% if include.caption %}
<figcaption>{{ include.caption }}</figcaption>
{% endif %}
{% endcapture %}
{% include blocks/_base.liquid type="media" content=content float=include.float align=include.align %}