Updated blog_item template to remove duplicate CSS classes in main image and redefined author variable.

This commit is contained in:
pmoreno.rodriguez 2023-01-04 15:49:49 +01:00
parent 7c8526864e
commit 656c2a59e4

View file

@ -1,9 +1,13 @@
<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 %}
{% if page.header.metadata.author %}
{% set author = page.header.metadata.author %}
{% elseif page.header.author %}
{% set author = page.header.author %} {% set author = page.header.author %}
{% else %} {% else %}
{% set author = page.header.taxonomy.author[0] %} {% set author = page.header.taxonomy.author[0] %}
{% endif %} {% endif %}
{% if author %} {% if author %}
{% set avatar = author|replace(' ', '-')|lower %} {% set avatar = author|replace(' ', '-')|lower %}
{% endif %} {% endif %}
@ -25,7 +29,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="meta"> <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> <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 %}
@ -33,13 +37,14 @@
</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>
{% elseif page.media.images %} {% 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 %}
{% if page.header.blog_hide_body is not defined or not page.header.blog_hide_body %}
<div itemprop="articleBody"> <div itemprop="articleBody">
{% if page.header.continue_link is sameas(false) %} {% if page.header.continue_link is sameas(false) %}
{{ page.content|raw }} {{ page.content|raw }}
{% if not truncate %} {% if not truncate %}
@ -53,8 +58,8 @@
{{ page.content|raw }} {{ page.content|raw }}
{% set show_prev_next = true %} {% set show_prev_next = true %}
{% endif %} {% endif %}
</div> </div>
{% endif %}
<footer> <footer>
<ul class="actions"> <ul class="actions">
@ -71,17 +76,21 @@
{% 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 %}
</ul>
{% endif %}
</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"></a></li> <li><a href="https://twitter.com/share" data-url="{{ page.url(true) }}" data-text="{{ page.title }}" class="icon brands fa-twitter">
<li><a href="http://www.facebook.com/sharer.php?u={{ page.url(true) }}" class="icon brands fa-facebook"></a></li> </a></li>
<li><a href="http://www.facebook.com/sharer.php?u={{ page.url(true) }}" class="icon brands fa-facebook">
</a></li>
</ul> </ul>
</footer> </footer>
</article> </article>