~mrls/essential

essential/layouts/pics/list.html -rw-r--r-- 651 bytes
27db479cMauro Morales Add pic archetypes 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{{ define "main" }}
<div>
  {{- partial "language.html" . -}}
  {{ with .Title }}<h1>{{ . | humanize }}</h1>{{ end }}
  <hr>
  {{ with .Content }}<div>{{ . }}</div>{{ end }}
</div>

{{ $totalPages := len .Pages }}
{{ if eq $totalPages 0 }}
{{ i18n "noRecordsFound" }}
{{ end }}
{{ range $index, $page := .Pages }}
  {{ if eq (mod $index 3) 0 }}
  <div class="gallery--3">
  {{ end }}
    <a href="{{ .RelPermalink }}">
      {{ with index (.Resources) 0 }}
        <img src="{{ .RelPermalink }}">
      {{ end }}
    </a>
  {{ if or (and (eq (mod $index 4) 0) (ne $index 0)) (eq (sub $totalPages 1) $index) }}
  </div>
  {{ end }}
{{ end }}
{{ end }}