{% extends "base.html" %}
{% block content %}
  {% for post in posts %}
    <article>
      <header>
        <a href="{{ baseurl }}/{{ post.hash }}.html">
          {{ post.title }}
        </a>
      </header>

      <span class="byline">
        by <span class="author">{{ post.author.name }}</span>
        in <span class="repo">
          <a href="{{ baseurl }}/{{ post.repo }}.html">
            /{{ post.repo }}
          </a>
        </span>
        at <time>{{ post.time | datetime }}</time>
      </span>

      {% if max_paragraphs -%}

        {% for para in post.body[:max_paragraphs] -%}
          {{ para | text | safe }}
          {%- endfor %}

          {% if post.body | length > max_paragraphs -%}
            <p>
              <a href="{{ baseurl }}/{{ post.hash }}.html" class="more">
                more...
              </a>
            </p>
          {%- endif %}

      {%- else -%}

        {% for para in post.body -%}
          {{ para | text | safe }}
        {%- endfor %}

      {%- endif %}
    </article>
  {% endfor %}
{% endblock %}
