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

{% block head %}
{{ blog.feedHeaders() }}
<style>
    .tag-list > * {
        padding-right: 0.3em;
    }
</style>
{% endblock %}

{% block main %}
<h1>{{ post.title }}</h1>

{% if post.description %}
<p class="h3">{{ post.description }}</p>
{% endif %}

<hr>

<div style="margin-bottom: 1em;"></div>
{{ content | safe }}
{% endblock %}

{% block aside %}
<p>
    Published: {{ post.publishedDate | fmtdate }}
    {% if post.updatedDate %}
        {% set comma = joiner(", ") %}
        <br>Updated: {% for d in post.updatedDate %}{{ comma() }}{{ d | fmtdate }}{% endfor %}
    {% endif %}
    {% if post.tags | length > 0 %}<br>Tags: 
        <span class="tag-list">{% for tag in post.tags %}<a href="/blog/tags/{{ tag }}/"><span class="pill">{{ tag }}</span></a>{% endfor %}</span>
    {% endif %}
</p>

{% if toc | length != 0 %}
    {{ tc.render(toc) }}
{% endif %}
{% endblock %}