grav/themes/quark-open-publishing/templates/partials/blog-item.html.twig

85 lines
3.3 KiB
Twig
Raw Normal View History

<div class="content-item h-entry">
{% if not hero_image_name %}
<div class="content-title text-center">
{% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
{% if not (grav.uri.param('hidepagetitle')) %}
{% if page.header.subtitle %}
<h3>{{ page.header.subtitle }}</h3>
{% endif %}
<p>
{% include 'partials/blog/date.html.twig' %}
{% if config.plugins.readingtime.enabled %}
<span class="blogitem__readingtime">{% include 'partials/blog/readingtime.html.twig' %}</span>
{% endif %}
</p>
{% include 'partials/blog/taxonomy.html.twig' %}
{% endif %}
</div>
{% endif %}
2023-01-11 23:13:10 +01:00
<div class="e-content">
{# check to hide post summary on page - hibbittsdesign.org #}
{% if page.parent.header.display_post_summary.enabled %}
{% set content = page.content|slice(page.summary | length) %}
{% else %}
{% set content = page.content %}
{% endif %}
{# check to show summary only - hibbittsdesign.org #}
{% if not (grav.uri.param('summaryonly') or grav.uri.param('onlysummary')) %}
{% if content is not empty %}
{{ content|raw }}
{% else %}
{{ page.summary|raw }}
{% endif %}
{% else %}
{{ page.summary|raw }}
{% if page.header.continue_link is same as(true) %}
<a href="{{ page.url ~ '/chromeless:true' }}" title="{{ page.title }}" class="btn btn-primary topwindow external-link">{{ 'THEME_QUARK.BLOG.ITEM.CONTINUE_READING'|t }}</a>
{% endif %}
{% endif %}
</div>
{% if config.plugins.comments.enabled %}
{% include 'partials/comments.html.twig' %}
{% endif %}
</div>
{# added check for content display flag - hibbittsdesign.org #}
{% if not (grav.uri.param('chromeless') or grav.uri.param('embedded') or grav.uri.param('standalone')) and not(theme_var('chromeless.enabled')) and not (grav.uri.param('summaryonly') or grav.uri.param('onlysummary')) %}
2023-01-12 00:47:15 +01:00
{% set options = { items: {'@page.children': '/news', '@page.children': '/events'}, 'order': {'by': 'modified', 'dir': 'asc'}} %}
2023-01-12 00:44:13 +01:00
{% set my_collection = page.collection(options) %}
{% do paginate( my_collection, 5 ) %}
2023-01-11 23:27:35 +01:00
2023-01-12 00:44:13 +01:00
{% for p in my_collection %}
<ul>
{% if page.slug == p.slug %}
<li class="{{ p.slug|e }} active"><span>{{ p.menu|e }}</span></li>
{% else %}
<li class="{{ p.slug|e }}"><a href="{{ p.url|e }}">{{ p.menu|e }}</a></li>
{% endif %}
</ul>
{% endfor %}
{% include 'partials/pagination.html.twig' with {'base_url':page.url, 'pagination':my_collection.params.pagination} %}
2023-01-11 23:27:35 +01:00
<p class="prev-next text-center">
{% if not page.isLast %}
<a class="btn" href="{{ page.prevSibling.url }}">
<i class="fa fa-angle-left"></i>
{{ 'THEME_QUARK.BLOG.ITEM.PREV_POST'|t }}
</a>
{% endif %}
2023-01-11 22:42:47 +01:00
{{ pagination }}
{% if not page.isFirst %}
<a class="btn" href="{{ page.nextSibling.url }}">{{ 'THEME_QUARK.BLOG.ITEM.NEXT_POST'|t }}
<i class="fa fa-angle-right"></i>
</a>
{% endif %}
</p>
{% endif %}