{% extends "./base.html" %}
{% load wagtailcore_tags %}
{% load static %}

{% block robots %}
  {% if blog.noindex %}
    <meta name="robots" content="noindex, nofollow">
  {% else %}
    <meta name="robots" content="index, follow">
  {% endif %}
{% endblock robots %}

{% block title %}
  <title>{{ page.seo_title }}</title>
{% endblock %}

{% block description %}
  <meta name="description" content="{{ page.search_description }}">
{% endblock %}

{% block header %}
  <header>
    <h1>{{ page.title }}</h1>
    <section>
      <h4>Description</h4>
      {{ page.description|richtext }}
    </section>
    <section>
      <h4>Feed</h4>
      <a href="{% url "cast:latest_entries_feed" slug=blog.slug %}">
        Link to RSS feed
      </a>
    </section>
  </header>
{% endblock header %}

{% block navigation %}
  <nav>
    <hr>
    {% include "./select_theme.html" %}
    <hr>
    {% include "./_filter_form.html" with form=filterset.form %}
    <hr>
  </nav>
{% endblock navigation %}

{% block main %}
  <main>
    {% include "./pagination.html" %}
    {% for post in posts %}
      {% include "./post_body.html" with render_detail=False page=post %}
    {% endfor %}
  </main>
{% endblock main %}

{% block footer %}
  <footer>
    {% include "./pagination.html" %}
  </footer>
{% endblock footer %}
