{# https://github.com/nephila/djangocms-blog/blob/1.1.1/djangocms_blog/templates/djangocms_blog/post_list.html #}
{% extends "djangocms_blog/post_list.html" %}
{% load cms_tags i18n %}

{% block content_blog %}
<div class="container">
    {% include "nav_cms_breadcrumbs.html" %}
    {# FAQ: The extended template adds `spaceless` but it fails #}
    {% spaceless %}
      {{ block.super }}
    {% endspaceless %}
    <script>
      /* HACK: To replace « and » of "« Previous" and "Next »" with < and > */
      [ ...document.querySelectorAll('.pagination a') ].forEach( a => {
        a.innerText = a.innerText.replace('«', '<').replace('»', '>');
      });
      /* HACK: To remove " »" from "read more »" */
      [ ...document.querySelectorAll('.read-more a') ].forEach( a => {
        a.innerText = a.innerText.replace(' »', '');
      });
    </script>
</div>
{% endblock content_blog %}

{% block blog_title %}
    <header>
        <h2>
        {% if author %}{% trans "Articles by" %} {{ author.get_full_name }}
        {% elif archive_date %}{% trans "Archive" %} &ndash; {% if month %}{{ archive_date|date:'F' }} {% endif %}{{ year }}
        {% elif tagged_entries %}{% trans "Tag" %} &ndash; {{ tagged_entries|capfirst }}
        {% elif category %}{% trans "Category" %} &ndash; {{ category }}
        {% else %}{% trans "News" %}{% endif %}
        </h2>
    </header>
{% endblock %}
