Post gallery support
This commit is contained in:
parent
52a4129939
commit
3d4c191376
3 changed files with 26 additions and 2 deletions
7
models/gallery.ini
Normal file
7
models/gallery.ini
Normal file
|
@ -0,0 +1,7 @@
|
|||
[model]
|
||||
name = Gallery
|
||||
label = gallery
|
||||
hidden = no
|
||||
|
||||
[pagination]
|
||||
enabled = no
|
|
@ -1,5 +1,5 @@
|
|||
{% extends "blog/_base.html" %}
|
||||
{% from "macros/blog.html" import render_blog_post %}
|
||||
{% from "macros/blog.html" import render_blog_post, render_gallery %}
|
||||
|
||||
{% block body_class %}blog post{% endblock %}
|
||||
|
||||
|
@ -7,8 +7,11 @@
|
|||
|
||||
{% block main_content %}
|
||||
{{ render_blog_post(this) }}
|
||||
{% if this.children.get("gallery") %}
|
||||
{{ render_gallery(this) }}
|
||||
{% endif %}
|
||||
<div class="center block-info">
|
||||
Comments have been disabled in this blog, if you want to contact me directly please <a href="{{ '/contact'|url }}">go ahead</a>!
|
||||
Comments have been disabled in this blog. If you want to contact me directly please use the information in the bottom of the page.
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue