Load background image or thumbnail for each of the post in the list
This commit is contained in:
parent
68ccb77f7f
commit
c17057f7e8
2 changed files with 4 additions and 3 deletions
|
|
@ -3,7 +3,8 @@
|
|||
<div class="post-preview">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{% if from_index %}<h2><a href="{{ post|url }}"><img style="margin-top:11%" src="{{post.thumbnail}}"/></a></h2>{% else %}<h2><img style="margin-top:11%" src="{{post.thumbnail}}"/></h2>{% endif %}
|
||||
{% 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 %}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
{% if from_index %}<a href="{{ post|url }}"><h2 class="post-title">{{ post.title }}</h2></a>
|
||||
|
|
@ -25,5 +26,4 @@
|
|||
{% else %}
|
||||
{{ post.body }}
|
||||
{% endif %}
|
||||
|
||||
{% endmacro %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue