The big shortcode cleanup
This commit is contained in:
@ -1,12 +1,50 @@
|
||||
<video class="
|
||||
{% if full %}full{% endif %}
|
||||
{% if full_bleed %}full-bleed{% endif %}
|
||||
{% if start %}start{% endif %}
|
||||
{% if end %}end{% endif %}
|
||||
{% if pixels %}pixels{% endif %}
|
||||
{% if transparent %}transparent{% endif %}
|
||||
{% if spoiler %}spoiler{% endif %}
|
||||
{% if spoiler and solid %}solid{% endif %}
|
||||
"
|
||||
{%- if alt -%}aria-title="{{ alt }}"{%- endif -%}
|
||||
controls src="{{ url }}"></video>
|
||||
{# Video classes #}
|
||||
{%- set video_classes = [] -%}
|
||||
{%- if full -%}
|
||||
{%- set video_classes = video_classes | concat(with="full") -%}
|
||||
{%- endif -%}
|
||||
{%- if full_bleed -%}
|
||||
{%- set video_classes = video_classes | concat(with="full-bleed") -%}
|
||||
{%- endif -%}
|
||||
{%- if start -%}
|
||||
{%- set video_classes = video_classes | concat(with="start") -%}
|
||||
{%- endif -%}
|
||||
{%- if end -%}
|
||||
{%- set video_classes = video_classes | concat(with="end") -%}
|
||||
{%- endif -%}
|
||||
{%- if pixels -%}
|
||||
{%- set video_classes = video_classes | concat(with="pixels") -%}
|
||||
{%- endif -%}
|
||||
{%- if transparent -%}
|
||||
{%- set video_classes = video_classes | concat(with="transparent") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler -%}
|
||||
{%- set video_classes = video_classes | concat(with="spoiler") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler and solid -%}
|
||||
{%- set video_classes = video_classes | concat(with="solid") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set video_classes = video_classes | join(sep=" ") -%}
|
||||
|
||||
{# Video attributes #}
|
||||
{%- set video_attributes = [] -%}
|
||||
{%- if autoplay -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="autoplay") -%}
|
||||
{%- endif -%}
|
||||
{%- if controls -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="controls") -%}
|
||||
{%- endif -%}
|
||||
{%- if loop -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="loop") -%}
|
||||
{%- endif -%}
|
||||
{%- if muted -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="muted") -%}
|
||||
{%- endif -%}
|
||||
{%- if playsinline -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="playsinline") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set video_attributes = video_attributes | join(sep=" ") -%}
|
||||
|
||||
<video class="{{ video_classes }}" src="{{ url }}" {%- if alt -%}aria-title="{{ alt }}"{%- endif -%} {{ video_attributes }}></video>
|
||||
|
Reference in New Issue
Block a user