summaryrefslogtreecommitdiff
path: root/themes/cranky/layouts/photography/list.html
blob: 77a4a24f680ac40a52271cd3caac2f13800caf7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{ define "title" -}} {{ .Title | title }} {{- end }} {{ define "main" -}} {{
.Content }}
<!-- Match all files in the gallery folder which are images -->
<div class="photo-gallery">
  {{- range sort (resources.Match "images/gallery/*") "Name" "desc" -}} {{
  $image := . }} {{ $small := $image.Resize "300x webp" }}
  <a href="{{ .RelPermalink }}" class="photo-item">
    <img
      src="{{ $small.RelPermalink }}"
      alt="{{ $image.Name }}"
      loading="lazy"
    />
  </a>
  {{ end -}}
</div>
{{- end }}