mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
Update author and avatar variables
This commit is contained in:
parent
d55f25c9b5
commit
99094c0aaf
1 changed files with 5 additions and 6 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue