{% extends "layout.html" %}
{% import "macros/layout.html" as layout %}
{% import "macros/post.html" as post %}

{% block title %}
    {% if page.title %}{{ page.title }} - {% endif %}
    {{ config.title }}
{% endblock %}

{% block content %}
    <a href="../">&laquo; back</a>
    <h1 style="margin: 0;">{{ page.title }}</h1>
    {% if page.date or page.author %}
    <small style="display: block; margin-bottom: 20px;">
        Posted
        {% if page.extra.author %}by {{ page.extra.author }}{% endif %}
        on {{ page.date }}
        - {{ page.reading_time }} min read
    </small>
    {% endif %}

    {% if page.extra.toc and toc | length %}
        <div class="toc">
            table of contents
            {{ post::render_toc(toc=toc) }}
        </div>
    {% endif %}

    <div id="content">{{ page.content | safe }}</div>
{% endblock %}