{{ define "main" }}
<div class="columns mt-5 is-variable is-6">
  <!--
  If the current blog post belongs to a case, we will add a side menu
  with all other blog posts belonging to that case, emphasis to the current.
  -->
  {{ with .CurrentSection.Params.Title }}
  <aside class="menu box column is-3">
    <p class="menu-label">
      Dans le dossier « {{ . }} »...
    </p>
    <div class="menu-list">
      {{ $posts := (where $.Site.RegularPages "CurrentSection.Params.Code" "==" $.CurrentSection.Params.Code )}}
      {{ $postsSorted := (sort $posts "Date" )}}
      {{ range $postsSorted }}
      <a {{ if eq $.Title .Title }} class="is-active" {{ end }} href="{{ .Permalink }}">{{ .Title }}</a>
      {{ end }}
    </div>
  </aside>
  {{ end }}
  <section class="column is-7">
    <aside>
      <div>
        <section>
          <time class="post-date" datetime="{{ .Date.Format `2006-01-02T15:04:05Z07:00` | safeHTML }}">
            Article publié le {{ .Date.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Date.Month) }} {{ .Date.Year }} (dernière modification le {{ .Lastmod.Day }} {{ index $.Site.Data.months_fr (printf "%d" .Lastmod.Month) }}
            {{ .Lastmod.Year }})
          </time>
          <h4>{{ .FuzzyWordCount }} mots </h4>
        </section>
      </div>
    </aside>
    <div>
      <article>
        {{ .Content }}
      </article>
    </div>
    <aside class="container level my-5">
      <div class="level-left">
        {{ with .PrevInSection }}
        <div class="level-item">
          <a class="button is-info" href="{{ .Permalink }}">&laquo;&laquo;&nbsp;{{ .Title }}</a>
        </div>
        {{ end }}
      </div>
      <div class="level-right">
        {{ with .NextInSection }}
        <div class="level-item">
          <a class="button is-info" href="{{ .Permalink }}">{{ .Title }}&nbsp;&raquo;&raquo;</a>
        </div>
        {{ end }}
      </div>
    </aside>
  </section>
  <aside class="column is-3">
    {{- partial "about.html" . -}}
  </aside>
</div>
{{ end }}