Merge pull request #210 from lektor/showcase-relisiancy

Making the showcase more resilient against slightly different sized thumbnails.
This commit is contained in:
Joseph Nix 2018-05-15 13:12:00 -05:00 committed by GitHub
commit 3dee211740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 9 deletions

View File

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