fix caption on video
This commit is contained in:
parent
ef199a5d52
commit
10a3253aa8
@ -1,5 +1,6 @@
|
|||||||
{% if section.image.type == "video" %}
|
{% if section.image.type == "video" %}
|
||||||
{% set video = Video(section.image) %}
|
{% set video = Video(section.image) %}
|
||||||
|
{% set caption = section.text %}
|
||||||
{{ video.copy() }}
|
{{ video.copy() }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set image = Image(section.image) %}
|
{% set image = Image(section.image) %}
|
||||||
@ -11,14 +12,22 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if video %}
|
{% if video %}
|
||||||
<section class="bordered-picture baguette" style="position: relative;">
|
<section class="bordered-picture baguette" style="position: relative;">
|
||||||
|
<div class="caption">
|
||||||
<img class="lazy" data-original="{{ video.generate_thumbnail("2000") }}" src="" alt="">
|
<img class="lazy" data-original="{{ video.generate_thumbnail("2000") }}" src="" alt="">
|
||||||
<video class="lazy" id="video" poster="{{ video.generate_thumbnail("2000") }}" alt="" autoplay="autoplay" loop="loop" preload="auto" muted>
|
<video class="lazy" id="video" poster="{{ video.generate_thumbnail("2000") }}" alt="" autoplay="autoplay" loop="loop" preload="auto" muted>
|
||||||
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
|
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
|
||||||
</video>
|
</video>
|
||||||
|
{% if caption %}
|
||||||
|
<div class="caption__overlay">
|
||||||
|
<h5 class="caption__overlay__title">{{ caption }}</h5>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
{% else %}
|
{% else %}
|
||||||
<section class="bordered-picture baguette">
|
<section class="bordered-picture baguette">
|
||||||
<div class="caption">
|
<div class="caption">
|
||||||
<a href="{{ image }} {% if caption %}data-caption="{{ caption }}"{% endif %}">
|
<a href="{{ image }}" {% if caption %}data-caption="{{ caption }}"{% endif %}>
|
||||||
<img class="lazy" src="" data-original="{{ image }}" alt="">
|
<img class="lazy" src="" data-original="{{ image }}" alt="">
|
||||||
{% if caption %}
|
{% if caption %}
|
||||||
<div class="caption__overlay">
|
<div class="caption__overlay">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user