Adrien Beudin cf42f9b8b4 fix html 2
2016-05-03 10:14:49 +02:00

35 lines
1.4 KiB
HTML

{% if section.image.type == "video" %}
{% set video = Video(section.image) %}
{% else %}
{% set image = Image(section.image) %}
{% set caption = section.text %}
{{ image.copy() }}
{% endif %}
{% if section.background %}
<div class="bg-section" style="background: {{ section.background }};">
{% endif %}
{% if video %}
<section class="bordered-picture baguette" style="position: relative;">
<img class="lazy" data-original="{{ video.generate_thumbnail("2000") }}" src="{{ video.generate_thumbnail("2000") }}" alt="">
<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">
</video>
{% else %}
<section class="bordered-picture baguette">
<div class="caption">
<a href="{{ image }} {% if caption %}data-caption="{{ caption }}"{% endif %}">
<img class="lazy" src="{{ image }}" data-original="{{ image }}" alt="">
{% if caption %}
<div class="caption__overlay">
<h5 class="caption__overlay__title">{{ caption }}</h5>
</div>
{% endif %}
</div>
</a>
{% endif %}
</section>
{% if section.background %}
</div>
{% endif %}