{{ define "hero" }}
{{ $ctx := . }}
{{ with .Params.image }}
{{ $heroContent := (print "<h1>" $ctx.Params.title "</h1>")}}
{{ partial "modular/hero.html" (dict
"image" .
"classes" $ctx.Params.heroClasses
"imageParallax" $ctx.Params.heroImageParallax
"align" $ctx.Params.heroAlign
"content" $heroContent ) }}
{{ end }}
{{ end }}

{{ define "body" }}
<section id="body-wrapper" class="section blog-listing">
  <section class="container {{ site.Params.GridSize }}" style="padding-top: 0;">
    <div class="columns">
      <div id="item" class="column col-12 extra-spacing">
        <div class="content-item h-entry">

          {{ partial "iconAndTitle.html" . }}

          {{ with .Params.imagesDir }}
          <h3>Screenshots</h3>

          {{ $imagesDir := printf "/static/%s/" . }}
          {{ $publicImagesDir := . }}
          {{ $files := sort (readDir $imagesDir) }}
          <div class="gallery gallery-scroll">
            {{ range $files }}
            {{ if hasPrefix .Name "screenshot-" }}
            <img class="gallery gallery-item" src="{{ site.BaseURL }}/{{ $publicImagesDir }}/{{ .Name }}"
              alt="{{ .Name }}">
            {{ end }}
            {{ end }}
          </div>
          {{ end }}

          <div class="e-content">
            <h3>About {{.Title}}</h3>
            {{ .Content }}

            {{ if or (.Params.links.googleplay) (.Params.links.appstore) (.Params.links.opensource) }}
            <h3>Downloads</h3>
            {{ with .Params.links.googleplay }}
            <a href="{{ . }}" target="blank"><img alt="Get it on Google Play"
                src="{{site.BaseURL}}/assets/GooglePlay.png"></a><br>
            {{ end }}
            {{ with .Params.links.appstore }}
            <a href="{{ . }}" target="blank"><img alt="Download on the App Store"
                src="{{site.BaseURL}}/assets/AppStore.png"></a><br>
            {{ end }}
            {{ with .Params.links.opensource }}
            <a href="{{ . }}" target="blank"><img alt="Download on the App Store"
                src="{{site.BaseURL}}/assets/GetSourceCode.png"></a><br>
            {{ end }}
            {{ end }}

            {{ with .Params.privacyPolicy }}
            <br>
            <h3>Privacy policy</h3>
            <p>
              {{ . | safeHTML }}
            </p>
            <a href="privacypolicy.html">privacy policy <i class="fa fa-angle-right"></i></a>
            {{ end }}

          </div>
        </div>

        <p class="prev-next text-center">
          {{/* if not page.isLast %}
          <a class="btn" href="{{ page.prevSibling.url }}"><i class="fa fa-angle-left"></i> {{ 'previous app'|t }}</a>
          {% endif %}

          {% if not page.isFirst %}
          <a class="btn" href="{{ page.nextSibling.url }}">{{ 'next app'|t }} <i class="fa fa-angle-right"></i></a>
          {% endif */}}
        </p>
      </div>
    </div>

  </section>
</section>
{{ end }}