{% extends "base.twig" %}

{% set title = post.title %}
{% set thumbnail = post.thumbnail %}

{% block content %}

<article class="post-single post-type-{{post.post_type}}" id="post-{{post.ID}}">

  <header class="post-single__header" data-scroll-section>
    <h1>{{ title }}</h1>

    <p class="post-single__author">
      By <a href="{{post.author.path}}">{{ post.author.name }}</a> / {{ post.date }}
    </p>

    <div class="post-single__body">
      {{ post.content }}
    </div>
  </header>


  <!-- comment box -->
  <section class="comment-box" data-scroll-section>
    <!-- comments -->
    <div class="comments">
        {% if post.comments %}
      <h3> comments </h3>
      {% for cmt in post.comments %}
          {% include "comment.twig" with {comment:cmt} %}
      {% endfor %}
        {% endif %}
    </div>

    {% if post.comment_status == "closed" %}
      <p> comments for this post are closed </p>
    {% else %}
        <!-- comment form -->
        {% include "comment-form.twig" %}
    {% endif %}
  </section>

</article>

{% endblock %}
