Update author and avatar variables

This commit is contained in:
pmoreno.rodriguez 2023-02-01 11:54:07 +01:00 committed by GitHub
parent d55f25c9b5
commit 99094c0aaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,12 +5,10 @@
{% elseif page.header.author %}
{% set author = page.header.author %}
{% else %}
{% set author = page.header.taxonomy.author[0] %}
{% set author = page.taxonomy.author[0] %}
{% endif %}
{% if author %}
{% set avatar = author|replace(' ', '-')|lower %}
{% endif %}
{% set avatar = page.media[page.header.avatarImage].url|e %}
<header>
<div class="title">
@ -31,7 +29,8 @@
<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>
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<a {% if page.taxonomy.author %} href="{{ base_url }}/author{{ config.system.param_sep }}{{ author }}" itemprop="url" {% endif %} class="author"><span class="name" rel="author">{{ author }}</span>{% if avatar %}<img src="{{ avatar }}" alt="{{ author }}" />{% endif %}</a>
{% endif %}
</div>
</header>
@ -91,4 +90,4 @@
</a></li>
</ul>
</footer>
</article>
</article>