{% import "_imports/blog.html" as blog %}
{% extends "_layouts/base.html" %}

{% block head %}
{{ blog.feedHeaders() }}
<script>
    const query = new URLSearchParams(window.location.search)
    const tag = query.get("tag")
    if (tag !== null) {
        document.location.replace(`/blog/tags/${tag}/`)
    }
</script>
{% endblock %}

{% block main %}
<h1>Blog</h1>

<p class="regular-margin">This blog has both an <a href="/blog/feed.atom">Atom</a> and a <a href="/blog/feed.json">JSON</a> feed. You can also see a <a href="/blog/tags/">list of post tags</a>.</p>
{{ blog.postList(posts) }}
{% endblock %}

{% block aside %}{% endblock %}