Files
ks-twenty-fifteen/templates/partials/blog_item.html.twig

152 lines
6.4 KiB
Twig

<article class="post type-post post-excerpt format-standard hentry {% if page.media.images %}has-post-thumbnail{% endif %}">
<div class="post-thumbnail">
{{ page.media.images|first.cropZoom(1038,437).html(page.title, page.title, 'attachment-post-thumbnail wp-post-image')|raw }}
</div>
<header class="entry-header">
{% if page.header.link %}
<h2 class="entry-title">
{% if page.header.continue_link is not sameas(false) %}
<a href="{{ page.url }}"></a>
{% endif %}
<a href="{{ page.header.link }}">{{ page.title }}</a>
</h2>
{% else %}
<h2 class="entry-title"><a href="{{ page.url }}">{{ page.title }}</a></h2>
{% endif %}
</header>
<div class="entry-content">
{% if page.header.continue_link is sameas(false) %}
{{ page.content|raw }}
{% if not truncate %}
{% set show_prev_next = true %}
{% endif %}
{% elseif truncate and page.summary != page.content %}
{{ page.summary|raw }}
<a class="more-link" href="{{ page.url }}">{{ 'READ_MORE'|t }}</a>
{% elseif truncate %}
{{ page.content|truncate(550)|raw }}
<a class="more-link" href="{{ page.url }}">{{ 'READ_MORE'|t }}</a>
{% else %}
{{ page.content|raw }}
{% set show_prev_next = true %}
{% endif %}
</div>
{% set author = authors[page.header.aura.author] %}
{% if author %}
{% set social = [
'linkedin',
'youtube',
'facebook',
'instagram',
'pinterest',
'website',
] %}
{% if not truncate %}
<div class="author-info">
<h2 class="author-heading">
{{ 'PUBLISHED_BY'|t }}
</h2>
<div class="author-avatar">
{% if author.image %}
{{ media['user://images/' ~ author.image|first.name].cropZoom(56,56).html('', author.name, 'avatar avatar-56')|raw }}
{{ page.media.images[page.header.avatar].cropZoom(56,56).html(page.header.avatar,page.header.avatar, 'avatar avatar-56')|raw }}
{% endif %}
{% if author.name or author.description %}
<div class="author-description">
{% if author.name %}
<h3 class="author-title">
{{ author.name }}
</h3>
{% endif %}
{% if author.description %}
<p class="author-bio">
{{ author.description }}
</p>
{% endif %}
</div>
{% endif %}
</div>
</div>
{% endif %}
{% endif %}
<footer class="entry-footer">
<span class="footer-icon">
<i class="fa-solid fa-calendar-days fa-xs"></i>
<time class="entry-date published updated" datetime="{{ page.date|date(config.system.pages.dateformat.short) }}">{{ page.date|date(config.system.pages.dateformat.default) }}</time>
</span>
{% if author.name %}
<span class="footer-icon">
<span class="author vcard">
<i class="fa-solid fa-user fa-xs"></i>
{{ author.name }}
</span>
</span>
{% endif %}
{% if page.taxonomy.tag %}
<span class="footer-icon">
<i class="fa-solid fa-tags fa-xs fa-fw"></i>
{% for tag in page.taxonomy.tag %}
<a href="{{ base_url }}/tag{{ config.system.param_sep }}{{ tag }}">{{ tag }}{% if not loop.last %},{% endif %}</a>
{% endfor %}
</span>
{% endif %}
</footer>
</article>
{% if not truncate %}
{% if config.plugins.comments.enabled %}
<div id="comments" class="comments-area">
{% include 'partials/comments.html.twig' %}
</div>
{% endif %}
{% if config.plugins.jscomments.enabled %}
<div id="comments" class="comments-area">
{{ jscomments()|raw }}
</div>
{% endif %}
{% endif %}
{% if show_prev_next %}
{% if page.nextSibling.media.images %}
<style type="text/css">
.post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); }
</style>
{% endif %}
{% if page.prevSibling.media.images %}
<style type="text/css">
.post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); }
</style>
{% endif %}
<nav class="navigation post-navigation" role="navigation">
<h2 class="screen-reader-text">Post navigation</h2>
<div class="nav-links">
{% if not page.isLast %}
<div class="nav-previous" {% if page.prevSibling.media.images %}style="background-image: url({{ page.prevSibling.media.images|first.cropZoom(1038,437).url }}");{% endif %}>
<a href="{{ page.prevSibling.url }}" rel="prev">
<span class="meta-nav" aria-hidden="true" {% if page.prevSibling.media.images %}style="color: #fff;"{% endif %}>{{ 'PREVIOUS'|t }}</span>
<span class="screen-reader-text">{{ 'PREVIOUS'|t }}</span>
<span class="post-title" {% if page.prevSibling.media.images %}style="color: #fff;"{% endif %}>{{ page.prevSibling.header.title }}</span>
</a>
</div>
{% endif %}
{% if not page.isFirst %}
<div class="nav-next" {% if page.nextSibling.media.images %}style="background-image: url({{ page.nextSibling.media.images|first.cropZoom(1038,437).url }}");{% endif %}>
<a href="{{ page.nextSibling.url }}" rel="next">
<span class="meta-nav" aria-hidden="true" {% if page.nextSibling.media.images %}style="color: #fff;"{% endif %}>{{ 'NEXT'|t }}</span>
<span class="screen-reader-text">{{ 'NEXT'|t }}</span>
<span class="post-title" {% if page.nextSibling.media.images %}style="color: #fff;"{% endif %}>{{ page.nextSibling.header.title }}</span>
</a>
</div>
{% endif %}
</div>
</nav>
{% endif %}