{% embed 'partials/base.html.twig' %}

{% block body %}
<body itemscope itemtype="http://schema.org/Article">
{% endblock %}

{% block content %}
    <main class="content {{ page.header.image ? 'tag-articleimage' : '' }}" role="main">
      <article class="post">
        {% if page.header.image %}
        <div class="article-image">
          <div class="post-image-image" style="background-image: url({% if page.header.image %}{{ page.media[page.header.image].url }}{% endif %})">
            {{ 'ARTICLE.IMAGE'|t }}
          </div>
          {% include 'partials/postmeta.html.twig' %}
        </div>
        {% else %}
        <div class="noarticleimage">
          {% include 'partials/postmeta.html.twig' %}
        </div>
        <br>
        <br>
        <br>
        {% endif %}
        <section class="post-content">
          <a name="topofpage"></a>
          {{ content|raw }}
        </section>


        {% if page.template == 'post' %}
        <footer class="post-footer">
          <section class="share">
            {% for social in site.social %}
              {% if social.share_url != null %}
                <a class="icon-{{ social.icon }}" href="{{ social.share_url }}{{ social.share_title }}{{page.title | escape}}{{ social.share_link }}{{site.url}}{{page.id}}"
                  onclick="window.open(this.href, '{{ social.icon }}-share', 'width=550,height=255');return false;">
                <i class="fa fa-{{ social.icon }}"></i><span class="hidden">{{ social.icon }}</span>
                </a>
              {% endif %}
            {% endfor %}
          </section>
        </footer>
        <div class="bottom-teaser cf">
          <div class="isLeft">
            <h5 class="index-headline featured"><span>{{ 'ARTICLE.AUTHOR'|t }}</span></h5>
            <section class="author">
              <div class="author-image" style="background-image: url({{ uri.rootUrl() }}{{site.author.image}})">{{ 'ARTICLE.AUTHOR_LOGO'|t }}</div>
              <h4>{{ site.author.name }}</h4>
              <p class="bio">{{site.author.bio}}</p>
              <hr>
              <p class="published">{{ 'ARTICLE.PUBLISHED'|t }} <time datetime="{{ page.date | date(site.date_short) }}">{{ page.date | date(site.date_short) }}</time></p>
            </section>
          </div>
          {# {{/post}} #}
          <div class="isRight">
            <h5 class="index-headline featured"><span>{{ 'ARTICLE.SUPPORTED'|t }}</span></h5>
            <footer class="site-footer">
              <section class="poweredby">{{ 'ARTICLE.SUPPORT_GRAV'|t }} <a href="http://getgrav.org" target="_blank"> Grav</a> {{ 'ARTICLE.SUPPORT_GRAV_THEME'|t }} <a href="https://forge.guilo.ch/loicguib/custom-mediator-theme-grav" target="_blank"> Mediator modifié</a></section>
              <div class="inner">
                <section class="copyright">{{ 'FOOTER.CONTENT'|t }} <a href="mailto:{{ site.email}}">{{ site.name }}</a> {{ "now"|date('Y') }} &bull; {{ 'FOOTER.RIGHTS'|t }} <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons BY-SA</a></section>
                <div class="inner" style="margin-top: 18px">
                  <a class="subscribe" href="{{ base_url_relative }}/blog.rss"> <span class="tooltip"> <i class="fa fa-rss"></i>{{ 'LINKS.RSS'|t }}</span></a>
                </div>
              </div>
            </footer>
          </div>
        </div>
        {% endif %}

      </article>

      {% include 'partials/comments.html.twig' with {'page': page} %}

    </main>
    <div class="bottom-closer">
      <div class="background-closer-image" {% if home.header.cover %} style="background-image: url({{ home.media[home.header.cover].brightness(-75).url }})"{% endif %}>
        Image
      </div>
      <div class="inner">
        <h1 class="blog-title">{{ site.title }}</h1>
        <h2 class="blog-description">{{ site.description }}</h2>
        <a href="{{ home.url }}" class="btn">{{ 'LINKS.BACK_OVERVIEW'|t }}</a>
      </div>
    </div>
{% endblock %}

{% block footer %}{% endblock %}

{% endembed %}
