Add gallery list
This commit is contained in:
@ -1,7 +1,31 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% for gallery in section.pages %}
|
||||
<a href="{{ gallery.permalink }}">{{ gallery.title }}</a>
|
||||
{% endfor %}
|
||||
<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>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user