Browse Source

Simplify logic to show thumbnail in the blog post list

- loads thumbnail from css style instead of placeholder image
- to change the color of the thumbnail refer blog-post-placeholder
class at the bottom of clean-blog.css
products
PCoder 3 years ago
parent
commit
fa965bd3f8
  1. 2
      templates/macros/blog.html

2
templates/macros/blog.html

@ -4,7 +4,7 @@
<div class="row">
<div class="col-md-4">
{% set image = post.attachments.images.first() %}
{% if from_index %}<h2><a href="{{ post|url }}"><img src="{% if image %}{{ image.thumbnail(240)|url }}{% else %}/u/static/images/blog-post-placeholder.png{% endif %}" alt=""/></a></h2>{% else %}<h2><img src="{% if image %}{{ image.thumbnail(240)|url }}{% else %}/u/static/images/blog-post-placeholder.png{% endif %}" alt=""/></h2>{% endif %}
<h2><a href="{{ post|url }}">{% if image %}<img src="{{ image.thumbnail(240)|url }}" alt=""/>{% else %}<div class="blog-post-placeholder"></div>{% endif %}</a></h2>
</div>
<div class="col-md-8">
{% if from_index %}<a href="{{ post|url }}"><h2 class="post-title">{{ post.title }}</h2></a>

Loading…
Cancel
Save