{{ define "main" }}
  <header class="post-header">
    <h1 id="title">{{ .Title }}</h1>
    <!--
      If it's a static page, then the post information is useless and
      therefore not displayed. The test checks if the page IS NOT a static
      page.
    -->
    {{- if ne .Layout "static" }}
    {{- partial "post-info.html" . -}}
    {{ end }}
  </header>
  <!--
    If in the front matter, the layout key is set to verse, then the class is
    added.
  -->
  <article {{ if eq .Layout "verse" }} class="content, {{ .Layout }}"
           {{ else }} class="content" {{ end -}}>
  <!--
    Displays the image associated to the post, if set in the front matter.
  -->
    {{ if .Params.postimage  -}}
    <figure class="post-image">
      <img src="/images/{{ .Params.postimage }}" alt="{{ .Params.postimagedescription }}">
    {{ if and (.Params.imageLicence) (.Params.imageAuthor) (.Params.imageUrl) }}
      <figcaption>
        {{ .Params.imageLicence }} <a href="{{ .Params.imageUrl }}" title="Lien vers l'image originale">{{ .Params.imageAuthor }}</a>
    {{ else if and (.Params.imageAuthor) (.Params.imageUrl) (.Params.imageService) (.Params.imageServiceUrl) }}
      <figcaption>
        Image de <a href="{{ .Params.imageUrl }}" title="Lien vers l'image originale">{{ .Params.imageAuthor }}</a> sur <a href="{{ .Params.imageServiceUrl }}" title="Lien vers la banque d'image originale">{{ .Params.imageService }}</a>
    {{ else if .Params.postimagedescription }}
      <figcaption>
        {{ .Params.postimagedescription }}
      </figcaption>
    {{ end }}
    </figure>
    {{ end }}
    {{ $title := .Title }}
    {{ if eq $title "Contacts" }}
      {{ if .Site.Params.online }}
        {{ partial "online" . }}
      {{ end }}
      {{ if .Site.Params.contactsPriv }}
        {{ partial "perso" . }}
      {{ end }}
    {{ end }}
    {{ if eq $title "Applications" }}
      {{ .Content -}}
      {{ partial "apps" . }}
    {{ end }}
    {{ if eq $title "À mon sujet" }}
      {{ .Content -}}
      {{ partial "me" . }}
    {{ else }}
      {{ if ne $title "Applications" }}
        {{ .Content -}}
      {{ end }}
    {{ end }}
  </article>
{{ end -}}