<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">

{{ partial "head.html" . }}

<body hx-boost="true" lang="{{ .Site.Language.Lang }}">
  {{ partial "nav.html" . }}
  {{ $projects := first 4 ((where (.Site.RegularPages.RelatedIndices . "services" ) "Type" "blog").ByLastmod ) }}
  {{ $numOfProjects := $projects | len}}

  {{ $contentClass := "s12 m9 l9" }}

  {{ if eq $numOfProjects 0 }}
    {{ $contentClass = "s12 m12 l12" }}
  {{ end }}

  <div id="page-content">
  <header class="service">
    <div class="container">
      <div class="row">
        <div class="col {{ $contentClass }}">
          <h2>{{ .Title }}</h2>
          <p>{{ .Params.shortDescription }}</p>
        </div>
      </div>
    </div>
  </header>

  <div id="content">
    {{ if isset .Params "id" }}
    {{ partial .Params.id . }}
    {{ else }}

    <div class="container">
      <div class="row">
        <div class="col {{ $contentClass }} servicecontent">
          {{ if (fileExists (printf "assets/%s" (index .Params.images 0))) -}}
            {{ $mainimage := resources.Get (index .Params.images 0) }}
            <p style="text-align: center"><img class="img-fluid" src="{{ $mainimage.RelPermalink }}" width="500"></p>
          {{ end }}
          <div style="text-align: justify;">
            {{ .Content }}
          </div>
        </div>

        {{ if gt $numOfProjects 0 }}
        <div class="col s12 m3 l3 servicesidebar">
          {{ partial "widgets/servicesidebar.html" (dict "projects" $projects "service" .) }}
        </div>
        {{ end }}

        </div>
        <!-- /.row -->

      </div>
      <!-- /.container -->

      {{ end }}
    </div>
    <!-- /#content -->
    </div>
    {{ partial "footer.html" . }}
</body>
</html>