{#
    _template/archive.html
    ~~~~~~~~~~~~~~~~~~~~~~~

    Template for post lists.
#}
{%- extends "page.html" %}
{% block body %}

  <style type="text/css">
    ul.ablog-archive {list-style: none; overflow: auto; margin-left: 0px}
    ul.ablog-archive li {float: left; margin-right: 5px; font-size: 80%}
  </style>


  {% set fa = ablog.fontawesome %}

  {% for archive in catalog %}
  {% if archive|length %}
  <div class="section">

    <h1>
      {% if atom_feed and fa %}
      <a href="{{ pathto(archive.path, 1) }}/atom.xml"><i class="fa fa-rss fa-rotate-270"></i></a>{% endif %}
      {{ header }}
      {% if archive.href %}
      <a href="{{ archive.href }}">{{ archive }}</a>
      {% else %}
      {{ archive }}
      {% endif %}
    </h1>
    {% for post in archive %}
    <div class="section">
      <h2><a href="{{ pathto(post.docname) }}{{ anchor(post) }}">{{ post.title }}</a></h2>

      <ul class="ablog-archive">
      <li>{% if post.published %}
      {% if fa %}<i class="fa fa-calendar"></i>{% endif %}
        {{ post.date.strftime("%b %d, %Y") }}
      {% else %}
        {% if fa %}<i class="fa fa-pencil"></i>{% endif %}
        {% if post.date %}{{ post.date.strftime("%b %d, %Y") }}
        {% else %} Draft {% endif %}
      {% endif %}
      </li>
      {% include "postcard2.html" %}</ul>

      {{ post.to_html(archive.docname) }}
      <p><a href="{{ pathto(post.docname) }}">{{ _("Read more ...") }}</a></p>
      <hr>
    </div>
    {% endfor %}
  </div>
  {% endif %}
  {% endfor %}
{% endblock %}
