[showcase-relisiancy] Making the showcase more resiliant against slightly different sized thumbnails.

This commit is contained in:
Joseph Nix 2018-05-15 12:26:32 -05:00
parent fabbc0f691
commit d39e55afbc
1 changed files with 15 additions and 9 deletions

View File

@ -16,15 +16,21 @@
<p> <p>
Click any of the showcases to learn a bit more about how it uses Lektor. Click any of the showcases to learn a bit more about how it uses Lektor.
<div class="showcase row"> <div class="showcase row">
{% for project in this.children %} {% for project_row in this.children | batch(2, '&nbsp;') %}
<div class="project col-md-6"> <div class="row">
<a href="{{ project|url }}"> {% for project in project_row %}
<h2>{{ project.name }}</h2> <div class="project col-md-6">
{% if project.cover_image %} <a href="{{ project|url }}">
{% set image = project.attachments.get(project.cover_image) %} <h2>{{ project.name }}</h2>
<div class="frame"><img src="{{ image.thumbnail(480)|url }}" width="100%" alt=""></div> {% if project.cover_image %}
{% endif %} {% set image = project.attachments.get(project.cover_image) %}
</a> <div class="frame">
<img src="{{ image.thumbnail(480)|url }}" width="100%" alt="">
</div>
{% endif %}
</a>
</div>
{% endfor %}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>