Files
com.xaymar.www/_includes/blocks/media.liquid
T

62 lines
2.6 KiB
Plaintext
Raw Normal View History

2021-12-25 09:49:27 +01:00
{% capture content %}
{% if include.link %}<a href="{% if include.link == true %}{{ include.url }}{% else %}{{ include.link }}{% endif %}" {% if include.caption %}alt="{{ include.caption }}"{% endif %} target="_blank">{% endif %}
2022-01-12 05:53:50 +01:00
{% assign file_info = site.static_files | where: "path", include.url %}
2021-12-25 09:49:27 +01:00
{% if include.type == "image" %}
<picture
2022-01-11 07:13:32 +01:00
class="content"
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}data-lazyload=""{% endif %}
{% comment %}
2021-12-25 11:01:32 +01:00
src="{{ include.url | absolute_url }}"
2022-01-12 05:53:50 +01:00
{% endcomment %}
2021-12-25 09:49:27 +01:00
{% if include.width %}width="{{ include.width }}"{% endif %}
{% if include.height %}height="{{ include.height }}"{% endif %}>
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}<noscript>{% endif %}
2021-12-25 09:49:27 +01:00
<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 %}>
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}</noscript>{% endif %}
2021-12-25 09:49:27 +01:00
</picture>
{% elsif include.type == "video" %}
<video controls
2022-01-11 07:13:32 +01:00
class="content"
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}data-lazyload=""{% endif %}
2021-12-25 11:01:32 +01:00
{% if include.poster %}poster="{{ include.poster | absolute_url }}"{% endif %}
{% if include.preload %}preload="{{ include.preload }}"{% endif %}
2022-01-12 05:53:50 +01:00
{% comment %}
2021-12-25 11:01:32 +01:00
src="{{ include.url | absolute_url }}"
2022-01-12 05:53:50 +01:00
{% endcomment %}
2021-12-25 09:49:27 +01:00
{% 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 %}
2021-12-25 11:01:32 +01:00
{% if include.loop %}loop="true"{% endif %}>
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}<noscript>{% endif %}
2021-12-25 09:49:27 +01:00
<source src="{{ include.url | absolute_url }}">
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}</noscript>{% endif %}
2021-12-25 09:49:27 +01:00
</video>
{% elsif include.type == "audio" %}
<audio controls
2022-01-11 07:13:32 +01:00
class="content"
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}data-lazyload=""{% endif %}
2021-12-25 11:01:32 +01:00
{% if include.preload %}preload="{{ include.preload }}"{% endif %}
2022-01-12 05:53:50 +01:00
{% comment %}
2021-12-25 11:01:32 +01:00
src="{{ include.url | absolute_url }}"
2022-01-12 05:53:50 +01:00
{% endcomment %}
2021-12-25 09:49:27 +01:00
{% 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 %}>
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}<noscript>{% endif %}
2021-12-25 09:49:27 +01:00
<source src="{{ include.url | absolute_url }}">
2022-01-12 05:53:50 +01:00
{% if include.lazyload %}</noscript>{% endif %}
2021-12-25 09:49:27 +01:00
</audio>
{% endif %}
2021-12-28 19:43:39 +01:00
{% if include.link %}
</a>
{% endif %}
2021-12-25 09:49:27 +01:00
{% if include.caption %}
<figcaption>{{ include.caption }}</figcaption>
{% endif %}
2022-02-25 07:53:57 +01:00
{% endcapture %}{% include blocks/_base.liquid type="media" content=content float=include.float align=include.align %}