You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
562 B
HTML

{{ $params := . }}
{{ $pages := $params.pages }}
{{ $result := slice }}
{{ $weights := $pages.GroupBy "Weight" }}
{{ range $i, $e := $weights }}
{{ if eq $e.Key 0 }}
{{ $weights = slice | append (first $i $weights) | append (after (add $i 1) $weights) | append $e }}
{{ break }}
{{ end }}
{{ end }}
{{ range $weights }}
{{ range (sort (.Pages.GroupBy "PublishDate") "Key").Reverse }}
{{ range .Pages.ByTitle }}
{{ $result = $result | append . }}
{{ end }}
{{ end }}
{{ end }}
{{ return $result }}