mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-07-02 16:18:54 +00:00
31 lines
1.2 KiB
Twig
31 lines
1.2 KiB
Twig
{% set miniposts_category = theme_var('miniposts_category') %}
|
|
{% set miniposts_number = config.theme.miniposts_number %}
|
|
|
|
<section>
|
|
<header class="">
|
|
<h3>{{ 'FUTURE.FEATURED'|t }}</h3>
|
|
</header>
|
|
<div class="mini-posts">
|
|
|
|
{% for p in page.evaluate({'@taxonomy.category':miniposts_category}).order('header.order', 'asc').slice(0,miniposts_number) %}
|
|
<article class="mini-post">
|
|
<header>
|
|
<h3><a href="{{ p.url }}">{{ p.title }}</a></h3>
|
|
<time class="published" datetime="{{p.date|dateTranslate(grav.config.system.pages.dateformat.short)}}">{{ p.date|dateTranslate(grav.config.system.pages.dateformat.short)}}</time>
|
|
<a href="{{ p.url }}" class="author"><img src="{{ p.media[p.header.avatarImage].url}}" alt="" /></a>
|
|
</header>
|
|
<a href="{{ p.url }}" class="image">
|
|
|
|
{% if p.header.primaryImage %}
|
|
{{ p.media[p.header.primaryImage].cropZoom(1038,437).loading('lazy').html('',p.title)|raw}}
|
|
{% else %}
|
|
{{p.media.images|first.cropZoom(1038,437).loading('lazy').html('',p.title)|raw}}
|
|
{% endif %}
|
|
</a>
|
|
</article>
|
|
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|
|
<!-- End of featured Section -->
|
|
|