From c17057f7e80dce6742823c4e7f0c4b1483f8af13 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 20 Nov 2019 18:09:01 +0530 Subject: [PATCH] Load background image or thumbnail for each of the post in the list --- templates/blog-post.html | 3 ++- templates/macros/blog.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/blog-post.html b/templates/blog-post.html index 962d881..f104578 100644 --- a/templates/blog-post.html +++ b/templates/blog-post.html @@ -2,7 +2,8 @@ {% from "macros/blog.html" import render_blog_post %} {% block title %}{{ this.title }}{% endblock %} {% block body %} -
+{% set background_image = this.attachments.images.first() %} +
diff --git a/templates/macros/blog.html b/templates/macros/blog.html index 2a71e01..22f5e88 100644 --- a/templates/macros/blog.html +++ b/templates/macros/blog.html @@ -3,7 +3,8 @@
- {% if from_index %}

{% else %}

{% endif %} + {% set image = post.attachments.images.first() %} + {% if from_index %}

{% else %}

{% endif %}
{% if from_index %}

{{ post.title }}

@@ -25,5 +26,4 @@ {% else %} {{ post.body }} {% endif %} - {% endmacro %}