Added page.header.metadata.author to blog_item template

This commit is contained in:
pmoreno.rodriguez 2023-01-09 21:21:12 +01:00
parent ff069ae021
commit d0f71738a2

View file

@ -1,25 +1,29 @@
<article class="post" itemprop="liveBlogUpdate" itemscope itemtype="http://schema.org/BlogPosting"> <article class="post" itemprop="liveBlogUpdate" itemscope itemtype="http://schema.org/BlogPosting">
{% if page.header.author %}
{% set author = page.header.author %} {% if page.header.metadata.author %}
{% else %} {% set author = page.header.metadata.author %}
{% set author = page.header.taxonomy.author[0] %} {% elseif page.header.author %}
{% endif %} {% set author = page.header.author %}
{% if author %} {% else %}
{% set avatar = author|replace(' ', '-')|lower %} {% set author = page.header.taxonomy.author[0] %}
{% endif %} {% endif %}
{% if author %}
{% set avatar = author|replace(' ', '-')|lower %}
{% endif %}
<header> <header>
<div class="title"> <div class="title">
{% if page.header.link %} {% if page.header.link %}
<h2 itemprop="headline"> <h2 itemprop="headline">
{% if page.header.continue_link is not sameas(false) %} {% if page.header.continue_link is not sameas(false) %}
<a href="{{ page.url }}"></a> <a href="{{ page.url }}"></a>
{% endif %} {% endif %}
<a href="{{ page.header.link }}">{{ page.title }}</a> <a href="{{ page.header.link }}">{{ page.title }}</a>
</h2> </h2>
{% else %} {% else %}
<h2 itemprop="headline"><a href="{{ page.url }}">{{ page.title }}</a></h2> <h2 itemprop="headline"><a href="{{ page.url }}">{{ page.title }}</a></h2>
{% endif %} {% endif %}
{% if page.header.subtitle %} {% if page.header.subtitle %}
<p itemprop="alternativeHeadline">{{ page.header.subtitle|raw }}</p> <p itemprop="alternativeHeadline">{{ page.header.subtitle|raw }}</p>
{% endif %} {% endif %}
@ -27,17 +31,16 @@
<div class="meta"> <div class="meta">
<time class="published" itemprop="datePublished" datetime="{{page.date|date("Y-m-d")}}">{{ page.date|date("M j, Y")}}</time> <time class="published" itemprop="datePublished" datetime="{{page.date|date("Y-m-d")}}">{{ page.date|date("M j, Y")}}</time>
{% if author %} {% 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 %} {% endif %}
</div> </div>
</header> </header>
{% if page.header.primaryImage %} {% 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> <a href="{{ page.url }}">{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}</a>
{% else %} {% 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> <a href="{{ page.url }}">{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}</a>
{% endif %} {% endif %}
<div itemprop="articleBody"> <div itemprop="articleBody">
@ -66,28 +69,26 @@
{% endif %} {% endif %}
{% if show_prev_next %} {% if show_prev_next %}
{% if not page.isLast %} {% 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> <li><a class="button" href="{{ page.prevSibling.url }}"><i class="fa fa-chevron-left"></i> {{'FUTURE.BLOG.ITEM.PREV_POST'|t}}</a></li>
{% endif %} {% endif %}
{% if not page.isFirst %} {% 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> <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 %}
{% endif %} {% endif %}
</ul> </ul>
<ul class="stats"> <ul class="stats">
{% if page.taxonomy.tag %} {% if page.taxonomy.tag %}
{% for tag in 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> <li><a href="{{ base_url }}/tag{{ config.system.param_sep }}{{ tag }}" itemprop="keywords">{{ tag }}</a></li>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<li><a href="https://twitter.com/share" data-url="{{ page.url(true) }}" data-text="{{ page.title }}" class="icon brands fa-twitter"> <li><a href="https://twitter.com/share" data-url="{{ page.url(true) }}" data-text="{{ page.title }}" class="icon brands fa-twitter">
</a></li> </a></li>
<li><a href="http://www.facebook.com/sharer.php?u={{ page.url(true) }}" class="icon brands fa-facebook"> <li><a href="http://www.facebook.com/sharer.php?u={{ page.url(true) }}" class="icon brands fa-facebook">
</a></li> </a></li>
</ul> </ul>
</footer> </footer>
</article> </article>