{% extends "base.html" %}

{%- block content %}
  <header class="pagehead">
    <h1>{{ page.title }}</h1>
    {%- if page.subtitle %}
      <h2>{{ page.subtitle }}</h2>
    {%- endif %}
  </header>
  {{ page.content }}

  {% for subpage in page.subpages %}
    <div class="post">
      <header>
        <h2><a href="{{ subpage.url }}">{{ subpage.title }}</a></h2>
        <div class="subheader">
          Posted on
          <span class="date">{{ subpage.date }}</span>

          in

          <ul class="tags">
            {%- for tag in subpage.tags %}
              {% if loop.last %} and {% endif %}
              <li class="tag">{{tag}}</li>{% if not loop.last %},{% endif %}
            {%- endfor %}</ul>.
        </div>
      </header>

      {{ subpage.content }}
    </div>
  {% endfor %}
{%- endblock %}

{% extends "base.html" %}

{%- block content %}
  <header class="pagehead">
    <h1>{{ page.title }}</h1>
    {%- if page.subtitle %}
      <h2>{{ page.subtitle }}</h2>
    {%- endif %}
  </header>
  {{ page.content }}

  {% for subpage in page.subpages|sort(reverse=True, attribute='date') %}
    <div class="post">
      <header>
        <h2><a href="{{ subpage.url }}">{{ subpage.title }}</a></h2>
        <div class="subheader">
          Posted on
          <span class="date">{{ subpage.date }}</span>

          in

          <ul class="tags">
            {%- for tag in subpage.tags %}
              {% if loop.last %} and {% endif %}
              <li class="tag">{{tag}}</li>{% if not loop.last %},{% endif %}
            {%- endfor %}</ul>.
        </div>
      </header>

      {{ subpage.content }}
    </div>
  {% endfor %}
{%- endblock %}

Sort blog posts by date, reversed.
Sort blog posts by date, reversed.
