kocandaci/templates/gallery-list.html

32 lines
990 B
HTML
Raw Permalink Normal View History

2024-01-12 16:31:33 +01:00
{% extends "base.html" %}
{% block content %}
2024-01-12 21:09:26 +01:00
<section class="wrap narrow centering">
<h1>Galerie</h1>
{{ section.content | safe }}
</section>
<section class="gallery-list wrap grid grid-4 grid-mobile-2">
{% for gallery in section.pages %}
<a href="{{ gallery.permalink }}">
{% if gallery.extra.thumbnail %}
{% set_global img = "." ~ gallery.path ~ gallery.extra.thumbnail %}
{% else %}
{% set_global img = "/static/img/placeholder.jpg" %}
{% for asset in gallery.assets %}
{% if asset is matching("[.](jpg|png)$") %}
{% set_global img = asset %}
{% break %}
{% endif %}
{% endfor %}
{% endif %}
{% set image = resize_image(path=img, width=300, height=200, op="fill") %}
<img src="{{ image.url }}" alt="{{ gallery.title }}">
<div>
<span class="title">{{ gallery.title }}</span>
<span class="year">{{ gallery.date | date(format="%Y") }}
</div>
</a>
{% endfor %}
</section>
2024-01-12 16:31:33 +01:00
{% endblock %}