{% extends 'base.html.twig' %}

{% block main %}
    {% if note %}
        <article class="h-entry">
            <header>
                <h1 class="p-name">Note {{ note.slug }}</h1>
                <p hidden><a class="p-author h-card" href="{{ url('index') }}">Joe Carstairs</a></p>
                <p hidden <a class="u-url" href="{{ url('note', { slug: note.slug }) }}">Permalink</a></p>
                <p>Added: <time class="dt-published">{{ note.publishedDate.format('c') }}</time></p>
            </header>

            <section class="e-content">
                {{ note.content|markdown_to_html }}
            </section>
        </article>
    {% else %}
        <main>
            <header>
                <h1>Note not found</h1>
            </header>
            <section>
                <p>I don't have a note '{{ slug }}'.</p>
                <p>Go back to <a href="/notes">Notes</a>.</p>
            </section>
        </main>
    {% endif %}
{% endblock %}
