Fix weight ordering

master
Will Faught 1 year ago
parent 99c439860d
commit 4a80de906e

@ -46,9 +46,19 @@
{{ partial "paige/page.html" . }}
{{ end }}
{{ $pager := false }}
{{ $unpinned := complement $pinned . }}
{{ $pagecollection := $unpinned.GroupByPublishDate "January 2006" }}
{{ $pager := $page.Paginate $pagecollection }}
{{ $weighted := where $unpinned "Weight" "gt" 0 }}
{{ if $weighted }}
{{ $pager = $page.Paginate $unpinned.ByWeight }}
{{ range $pager.Pages }}
{{ partial "paige/page.html" . }}
{{ end }}
{{ else }}
{{ $pager = $page.Paginate ($unpinned.GroupByPublishDate "January 2006") }}
{{ $pagegroups := $pager.PageGroups }}
{{ range $pagegroups }}
@ -60,6 +70,7 @@
{{ partial "paige/page.html" . }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ if or $pager.HasPrev $pager.HasNext }}

Loading…
Cancel
Save