mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
Added page.header.metadata.author to blog_item template
This commit is contained in:
parent
ff069ae021
commit
d0f71738a2
1 changed files with 40 additions and 39 deletions
|
@ -1,25 +1,29 @@
|
|||
<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 %}
|
||||
|
||||
{% if page.header.metadata.author %}
|
||||
{% set author = page.header.metadata.author %}
|
||||
{% elseif 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.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 %}
|
||||
|
@ -27,18 +31,17 @@
|
|||
<div class="meta">
|
||||
<time class="published" itemprop="datePublished" datetime="{{page.date|date("Y-m-d")}}">{{ page.date|date("M j, Y")}}</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>
|
||||
<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, 'image featured')|raw }}</a>
|
||||
{% else %}
|
||||
<a href="{{ page.url }}" class="image featured">{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}</a>
|
||||
{% endif %}
|
||||
{% if page.header.primaryImage %}
|
||||
<a href="{{ page.url }}">{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}</a>
|
||||
{% else %}
|
||||
<a href="{{ page.url }}">{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}</a>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div itemprop="articleBody">
|
||||
|
||||
{% if page.header.continue_link is sameas(false) %}
|
||||
|
@ -66,28 +69,26 @@
|
|||
{% 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 %}
|
||||
{% 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 %}
|
||||
{% 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>
|
||||
</article>
|
Loading…
Add table
Reference in a new issue