{% extends "base.html" %}

{% block title %}{{ article.title }} - {{ super() }}{% endblock title %}
{% block description %}{{ article.content|striptags|truncate(200)|escape }}{% endblock description %}
{% block keywords %}{% for tag in article.tags|sort %}{{ tag }}{% if not loop.last %}, {% endif %}{% endfor %}{% endblock keywords %}

{% block headerstyle %}
    {% if article.illustration %}
    <div class="header-container" style="background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('{{ SITEURL }}/images/{{ article.illustration }}'); background-position: center; background-size: cover;">
    {% elif NEST_HEADER_IMAGES %}
    <div class="header-container" style="background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('{{ SITEURL }}/images/{{ NEST_HEADER_IMAGES }}'); background-position: center; background-size: cover;">
    {% else %}
    <div class="header-container gradient">
    {% endif %}
{% endblock headerstyle %}

{% block header %}
    <!-- Header -->
    <div class="container header-wrapper">
        <div class="row">
              <div class="col-lg-12">
                  <div class="header-content">
                      <h1 class="header-title">{{ article.title }}</h1>
                      <p class="header-date">{{ NEST_ARTICLE_HEADER_BY }} {% for author in article.authors %}<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>{% if not loop.last %}, {% endif %}{% endfor %}, {{ article.locale_date }}{% if article.modified %}, {{ NEST_ARTICLE_HEADER_MODIFIED }} {{ article.locale_modified }}{% endif %}, {{ NEST_ARTICLE_HEADER_IN }} <a href="{{ SITEURL }}/{{ category.url }}">{{ article.category|capitalize }}</a></p>
                      <div class="header-underline"></div>
                      <div class="clearfix"></div>
                      <p class="pull-right header-tags">
                          <span class="glyphicon glyphicon-tags mr5" aria-hidden="true"></span>
                          {% for tag in article.tags|sort %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}
                      </p>
                  </div>
              </div>
        </div>
    </div>
    <!-- /Header -->
{% endblock header %}

{% block content %}
    <div class="container content">
        {{ article.content }}

        {% if article.related_posts %}
            <h4>Articles connexes</h4>
            <dl class="dl-horizontal">
            {% for related_post in article.related_posts %}
                <dt>{{ related_post.locale_date}}</dt>
                <dd><a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></dd>
            {% endfor %}
            </dl>
        {% endif %}

        {% include "disqus_script.html" %}
        
    </div>
{% endblock %}
