{% extends "base.html" %}

{% block pagemeta %}

<title>{{ page.title }} - {{ config.title }}</title>
<meta property="og:title" content="{{ page.title }}" />
<meta property="og:url" content="{{ page.permalink | safe }}" />

{% if page.description %}
<meta name="description">{{ page.description }}</meta>
<meta property="og:description" content="{{ page.description }}" />
{% else %}
<meta property="og:description" content="{{ config.description }}" />
{% endif %}

{% if page.extra.use_asciinema %}
<script id="asciinema-player" defer type="text/javascript" src="{{ get_url(path='js/asciinema-player.min.js', cachebust=true) | safe }}"></script>
<link type="text/css" rel="stylesheet" href="{{ get_url(path='css/asciinema-player.css', cachebust=true) | safe }}">
{% endif %}

{% endblock pagemeta %}

{% block content %}
<div class="post" typeof="BlogPosting">
<header class="page-header">
<h1 property="headline">{{ page.title | markdown(inline=true) | safe }}</h1>

{% if not page.extra.isPage %}
<div class="detail page-detail">
    <span property="datePublished"
        content="{{ page.date | date }}"
        >{{ page.date | date(format=config.extra.dtformat) }}</span>
    <span>{{ page.reading_time }} minute read</span>
</div>
{% endif %}
</header>

{{ page.content | safe }}

{% if config.extra.debug %}
    <pre><code>{{ __tera_context | escape | safe }}</code></pre>
{% endif %}

{# back/forward buttons #}
{% if not page.extra.isPage %}
<nav class="article-nav">
    <ul>
        <li>
            <div id="newer-post" class="nav-label">Newer post</div>
        {% if page.lower %}
            <a href="{{ page.lower.permalink | safe }}"
                aria-labelledby="newer-post">← {{ page.lower.title }}</a>
        {% else %}
            <span class="disabled-link">←</span>
        {% endif %}
        </li>{#

        #}<li class="older">
            <div id="older-post" class="nav-label">Older post</div>
        {% if page.higher %}
            <a href="{{ page.higher.permalink | safe }}"
                aria-labelledby="older-post">{{ page.higher.title }} →</a>
        {% else %}
            <span class="disabled-link">→</span>
        {% endif %}
        </li>
    </ul>
</nav>
{% endif %}

</div>
{% endblock content %}
