diff --git a/models/gallery.ini b/models/gallery.ini new file mode 100644 index 0000000..157852c --- /dev/null +++ b/models/gallery.ini @@ -0,0 +1,7 @@ +[model] +name = Gallery +label = gallery +hidden = no + +[pagination] +enabled = no diff --git a/templates/blog/post.html b/templates/blog/post.html index d572adf..0cebdeb 100644 --- a/templates/blog/post.html +++ b/templates/blog/post.html @@ -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 %}
- Comments have been disabled in this blog, if you want to contact me directly please go ahead! + Comments have been disabled in this blog. If you want to contact me directly please use the information in the bottom of the page.
{% endblock %} diff --git a/templates/macros/blog.html b/templates/macros/blog.html index aed8f86..5c479cc 100644 --- a/templates/macros/blog.html +++ b/templates/macros/blog.html @@ -20,3 +20,17 @@
{% endmacro %} + +{% macro render_gallery(post) %} +
+

Gallery

+
+ {% for attachment in post.children.get("gallery").attachments.order_by("_id") %} + + + + {% endfor %} +
+
+
+{% endmacro %}