Media and Floating blocks

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2021-12-25 09:49:27 +01:00
parent 9322700142
commit 02c261bf55
9 changed files with 53 additions and 11 deletions
+37
View File
@@ -0,0 +1,37 @@
{% capture content %}
{% if include.type == "image" %}
<picture
{% 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
{% if include.width %}width="{{ include.width }}"{% endif %}
{% if include.height %}height="{{ include.height }}"{% endif %}
{% if include.preload %}preload="{{ include.preload }}"{% endif %}
{% if include.autoplay %}autoplay="true"{% endif %}
{% if include.muted %}muted="true"{% endif %}
{% if include.loop %}loop="true"{% endif %}
{% if include.poster %}poster="{{ include.poster | absolute_url }}"{% endif %}>
<source src="{{ include.url | absolute_url }}">
</video>
{% elsif include.type == "audio" %}
<audio controls
{% if include.width %}width="{{ include.width }}"{% endif %}
{% if include.height %}height="{{ include.height }}"{% endif %}
{% if include.preload %}preload="{{ include.preload }}"{% 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.caption %}
<figcaption>{{ include.caption }}</figcaption>
{% endif %}
{% endcapture %}
{% include blocks/_base.liquid type="media" content=content float=include.float %}