Post gallery support

This commit is contained in:
Felipe M 2019-12-14 22:46:57 +01:00
parent 52a4129939
commit 3d4c191376
Signed by: fmartingr
GPG key ID: 716BC147715E716F
3 changed files with 26 additions and 2 deletions

View file

@ -20,3 +20,17 @@
<hr class="light">
</article>
{% endmacro %}
{% macro render_gallery(post) %}
<div class="center">
<h2>Gallery</h2>
<div style="display: flex; justify-content: center; flex-flow: row wrap; ">
{% for attachment in post.children.get("gallery").attachments.order_by("_id") %}
<a href="/blog/{{post._slug}}/gallery/{{attachment._id}}" style="width: 30%">
<img src="/blog/{{post._slug}}/gallery/{{attachment._id}}">
</a>
{% endfor %}
</div>
<hr class="light">
</div>
{% endmacro %}