Fix weight ordering
This commit is contained in:
@@ -46,9 +46,19 @@
|
|||||||
{{ partial "paige/page.html" . }}
|
{{ partial "paige/page.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $pager := false }}
|
||||||
{{ $unpinned := complement $pinned . }}
|
{{ $unpinned := complement $pinned . }}
|
||||||
{{ $pagecollection := $unpinned.GroupByPublishDate "January 2006" }}
|
{{ $weighted := where $unpinned "Weight" "gt" 0 }}
|
||||||
{{ $pager := $page.Paginate $pagecollection }}
|
|
||||||
|
{{ 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 }}
|
{{ $pagegroups := $pager.PageGroups }}
|
||||||
|
|
||||||
{{ range $pagegroups }}
|
{{ range $pagegroups }}
|
||||||
@@ -60,6 +70,7 @@
|
|||||||
{{ partial "paige/page.html" . }}
|
{{ partial "paige/page.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ if or $pager.HasPrev $pager.HasNext }}
|
{{ if or $pager.HasPrev $pager.HasNext }}
|
||||||
|
Reference in New Issue
Block a user