{{ define "main" }}
<div class="container" role="main">
  <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
          {{ partial "breadcrumb.html" . }}
      </div>
    <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
      <article role="main" class="blog-post">
        {{ .Content }}

        {{ if .Params.tags }}
          <div class="blog-tags">
            {{ range .Params.tags }}
              <a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a>&nbsp;
            {{ end }}
          </div>
        {{ end }}

        {{ if $.Param "socialShare" }}
            <hr/>
            <section id="social-share">
              <div class="list-inline footer-links">
                {{ partial "share-links" . }}
              </div>
            </section>
        {{ end }}

        {{ if .Site.Params.showRelatedPosts }}
          {{ range first 1 (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
            {{ $.Scratch.Set "has_related" true }}
          {{ end }}

          {{ if $.Scratch.Get "has_related" }}
                  <h4 class="see-also">{{ i18n "seeAlso" }}</h4>
                  <ul>
                {{ $num_to_show := .Site.Params.related_content_limit | default 5 }}
                {{ range first $num_to_show (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
                    <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
                {{ end }}
              </ul>

          {{ end }}
        {{ end }}
      </article>

      {{ if ne .Type "page" }}
        <ul class="pager blog-pager">
          {{ if .PrevInSection }}
            <li class="previous">
              <a href="{{ .PrevInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .PrevInSection.Title }}">&larr; {{ i18n "previousPost" }}</a>
            </li>
          {{ end }}
          {{ if .NextInSection }}
            <li class="next">
              <a href="{{ .NextInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .NextInSection.Title }}">{{ i18n "nextPost" }} &rarr;</a>
            </li>
          {{ end }}
        </ul>
      {{ end }}

    </div>
  </div>
</div>
{{ end }}