Sort images by Exif date

Hey, I search for a solution to sort the images I process by the date they were taken from the exif data.
The problem is, I found no documentation about this and if this is even possible at the moment with a combination of the range and sort functions.

My template looks like this so far:

{{ $images := (.Page.Resources.Match (printf "%s*" (.Get "folder"))) }}
{{- range $index, $img := $images }}

But this sorts the images by the filename only. Any suggestions?

Found a solution with an additional step:

  {{ $images := (.Page.Resources.Match (printf "%s*" (.Get "folder"))) }}
  {{ $sorted_images := sort $images "Exif.Date" "desc" }}
  {{- range $index, $img := $sorted_images }}

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.