{{ define "main" }}
  <main class="content page-template page-{{ .Slug }}">
    <header id="site-page-head" >
      {{ $translations := .Page.AllTranslations }}
      <div id="top-banner" class="inner">
      {{ $num_lang := len $translations }}
      {{ if and (gt $num_lang 1) $.Site.Params.language_menu }}
        <div id="site-languages" class="inner">
            {{ range $translations }}
            {{ $lang_title := .Lang | strings.ToUpper }}
            {{ if eq .Lang $.Lang }}
                {{ if $.Site.Params.show_current_lang }}
                <span class='btn-lang active'>
                {{ $img_lang_temp := (printf "images/lang-%s-100.png" .Lang) }}
                {{ with resources.Get  $img_lang_temp }}
                <img id="flag-logo" alt="" src="{{ .RelPermalink }}" />{{ end }}
            {{ $lang_title }}</span>
                {{ end }}
            {{ else }}
                <a class='btn-lang' href='{{ .RelPermalink }}'>{{ $img_lang_temp := (printf "images/lang-%s-100.png" .Lang) }}
                {{ with resources.Get  $img_lang_temp }}
                <img id="flag-logo" alt="" src="{{ .RelPermalink }}" />{{ end }}&nbsp;{{ $lang_title }}</a>
            {{ end }}
            {{ end }}
        </div>
      {{ end }}
      {{ $back_to_home := .Site.Params.back_to_home }}
      {{ $back_link := "/" | relLangURL}}
      {{ with .Parent }}
        {{ $back_link = .RelPermalink | relLangURL }}
      {{ end }}
      {{ with .Param "back_link" }}
          {{ $back_link = . | relLangURL }}
      {{ end }}
        <div id="site-menu" class="inner">
          <a class='btn site-menu' href='{{ $back_link }}'><i class="fa fa-angle-left"></i>&nbsp;{{ $back_to_home }}</a>
        </div>
      </div>
    </div> 
    </header>
    <article class="post page">
      <h1 class="post-title">{{ .Title }}</h1>
      <section class="post-content">
        {{ .Content }}
      </section>
    </article>
  </main>
{{ end }}