mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-07-22 18:08:55 +00:00
Improved the definition of variables.
Improved the definition of title, subtitle and image variables.
This commit is contained in:
parent
72440d8d27
commit
43b0da2882
1 changed files with 4 additions and 7 deletions
|
@ -1,16 +1,13 @@
|
|||
<section>
|
||||
<ul class="posts">
|
||||
{% for p in page.find(theme_config.blog_page).children.order('date', 'desc').slice(0, 5) %}
|
||||
{% if p.header.primaryImage %}
|
||||
{% set bannerimage = p.media[p.header.primaryImage]%}
|
||||
{% else %}
|
||||
{% set bannerimage = p.media.images|first %}
|
||||
{% endif %}
|
||||
{% set image = p.media[p.header.primaryImage] ?: p.media.images|first %}
|
||||
{% set title = p.title|raw %}
|
||||
<li>
|
||||
<article>
|
||||
<header>
|
||||
<h3>
|
||||
<a href="{{p.url}}">{{ p.title }}</a>
|
||||
<a href="{{p.url}}">{{ title }}</a>
|
||||
</h3>
|
||||
{% if config.plugins["translate-date"].enabled %}
|
||||
<time class="published" datetime="{{ p.date|td(null, "Y-m-d") }}">{{ p.date|td(null, "M j, Y") }}</time>
|
||||
|
@ -19,7 +16,7 @@
|
|||
{% endif %}
|
||||
</header>
|
||||
<a href="{{p.url}}" class="image">
|
||||
{{ bannerimage.cropZoom(64,64).quality(60).loading('lazy').html('',p.title)|raw }}
|
||||
{{ image.cropZoom(64,64).quality(60).loading('lazy').html(title,title)|raw }}
|
||||
</a>
|
||||
</article>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Reference in a new issue