Browse Source

Adding sort_order to single.html

Adding sort_order parameter when sorting images in single.html. Defaults to the normal ascending order.
pull/6/head
runil 2 years ago
committed by GitHub
parent
commit
f4b665afae
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      layouts/_default/single.html

4
layouts/_default/single.html

@ -1,6 +1,6 @@
{{ define "main"}} {{ define "main"}}
<ul class="grid" id="target"> <ul class="grid" id="target">
{{ $photos := sort (.Resources.ByType "image") (index .Params "sort_by" |default "Name") }} {{ $photos := sort (.Resources.ByType "image") (index .Params "sort_by" |default "Name") (index .Params "sort_order" |default "asc") }}
{{- partial "photos.html" $photos -}} {{- partial "photos.html" $photos -}}
</ul> </ul>
{{ end }} {{ end }}

Loading…
Cancel
Save