mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-07-16 06:58:56 +00:00
87 lines
3.7 KiB
Twig
87 lines
3.7 KiB
Twig
<article class="post" itemprop="liveBlogUpdate" itemscope itemtype="http://schema.org/BlogPosting">
|
|
{% if page.header.author %}
|
|
{% set author = page.header.author %}
|
|
{% else %}
|
|
{% set author = page.header.taxonomy.author[0] %}
|
|
{% endif %}
|
|
{% if author %}
|
|
{% set avatar = author|replace(' ', '-')|lower %}
|
|
{% endif %}
|
|
|
|
<header>
|
|
<div class="title">
|
|
{% if page.header.link %}
|
|
<h2 itemprop="headline">
|
|
{% 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 itemprop="headline"><a href="{{ page.url }}">{{ page.title }}</a></h2>
|
|
{% endif %}
|
|
{% if page.header.subtitle %}
|
|
<p itemprop="alternativeHeadline">{{ page.header.subtitle|raw }}</p>
|
|
{% endif %}
|
|
</div>
|
|
<div class="meta">
|
|
<time class="published" itemprop="datePublished" datetime="{{page.date|dateTranslate(grav.config.system.pages.dateformat.short)}}">{{ page.date|dateTranslate(grav.config.system.pages.dateformat.short)}}</time>
|
|
{% if author %}
|
|
<a href="{{ base_url }}/author{{ config.system.param_sep }}{{ author }}" itemprop="keywords" class="author">{{ tag }}<span class="name" rel="author">{{ author }}</span>{% if page.header.avatarImage %}<img src="{{ page.media[page.header.avatarImage].url|e}}" alt="{{ author }}" />{% endif %}</a>
|
|
{% endif %}
|
|
</div>
|
|
</header>
|
|
|
|
{% if page.header.primaryImage %}
|
|
<a href="{{ page.url }}" class="image featured">{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title)|raw }}</a>
|
|
{% elseif page.media.images %}
|
|
<a href="{{ page.url }}" class="image featured">{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title)|raw }}</a>
|
|
{% endif %}
|
|
|
|
{% if page.header.blog_hide_body is not defined or not page.header.blog_hide_body %}
|
|
<div itemprop="articleBody">
|
|
{% 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 }}
|
|
{% elseif truncate %}
|
|
{{ page.content|truncate(550)|raw }}
|
|
{% else %}
|
|
{{ page.content|raw }}
|
|
{% set show_prev_next = true %}
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<footer>
|
|
<ul class="actions">
|
|
{% if truncate and page.summary != page.content %}
|
|
<li><a href="{{ page.url }}" class="button">{{'FUTURE.BLOG.ITEM.CONTINUE_READING'|t}}</a></li>
|
|
{% elseif truncate %}
|
|
<li><a href="{{ page.url }}" class="button">{{'FUTURE.BLOG.ITEM.CONTINUE_READING'|t}}</a></li>
|
|
{% endif %}
|
|
|
|
{% if show_prev_next %}
|
|
{% if not page.isLast %}
|
|
<li><a class="button" href="{{ page.prevSibling.url }}"><i class="fa fa-chevron-left"></i> {{'FUTURE.BLOG.ITEM.PREV_POST'|t}}</a></li>
|
|
{% endif %}
|
|
{% if not page.isFirst %}
|
|
<li><a class="button" href="{{ page.nextSibling.url }}">{{'FUTURE.BLOG.ITEM.NEXT_POST'|t}} <i class="fa fa-chevron-right"></i></a></li>
|
|
{% endif %}
|
|
{% endif %}
|
|
</ul>
|
|
|
|
<ul class="stats">
|
|
{% if page.taxonomy.tag %}
|
|
{% for tag in page.taxonomy.tag %}
|
|
<li><a href="{{ base_url }}/tag{{ config.system.param_sep }}{{ tag }}" itemprop="keywords">{{ tag }}</a></li>
|
|
{% endfor %}
|
|
{% endif %}
|
|
<li><a href="https://twitter.com/share" data-url="{{ page.url(true) }}" data-text="{{ page.title }}" class="icon brands fa-twitter"></a></li>
|
|
<li><a href="http://www.facebook.com/sharer.php?u={{ page.url(true) }}" class="icon brands fa-facebook"></a></li>
|
|
</ul>
|
|
</footer>
|
|
</article>
|