{% load static %}
{% load djpress_tags %}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% page_title post_text="| " %}{% site_title %}</title>
    <link rel="stylesheet" href="{% static 'default/css/style.css' %}">
    {% rss_link %}
    {% djpress_header %}
  </head>
  <body>
    <header>
      <h1>{% site_title link=True %}</h1>
      {% site_pages %}
    </header>
    <main>
      {% search_title "h1" pre_text="Search Results for '" post_text="'" %}
      {% category_title "h1" pre_text="View Posts in the " post_text=" Category" %}
      {% tag_title "h1" pre_text="View Posts Tagged with " %}
      {% author_name "h1" pre_text="View Posts by " %}
      {% if post %}
        {% post_wrap %}
          {% post_title outer_tag="h1" %}
          {% post_content outer_tag="section" %}
          <footer>
            <p>By {% post_author %}. {% post_date %}</p>
            <p>Categories: {% post_categories outer_tag="span" link_class="badge" %}</p>
            <p>Tags: {% post_tags outer_tag="span" link_class="badge" %}</p>
          </footer>
        {% end_post_wrap %}
      {% else %}
        <h1>Latest Posts</h1>
        {% search_errors %}
        {% for post in posts %}
          {% post_wrap %}
            {% post_title outer_tag="h1" %}
            {% post_content outer_tag="section" %}
            <footer>
              <p>
                By: {% post_author %}. <a href="{% get_post_url %}">{% get_post_date %}</a>
              </p>
              <p>Categories: {% post_categories outer_tag="span" link_class="badge" %}</p>
              <p>Tags: {% post_tags outer_tag="span"  link_class="badge" %}</p>
            </footer>
          {% end_post_wrap %}
        {% empty %}
          <p>No posts available.</p>
        {% endfor %}
      {% endif %}
      {% pagination_links %}
    </main>
    <footer>
      <p>
        Powered by
        <a href="https://www.djangoproject.com/"
           title="The web framework for perfectionists with deadlines">Django</a>
        and
        <a href="#">DJPress</a>
      </p>
      {% djpress_footer %}
    </footer>
  </body>
</html>
