2023-10-12 21:08:58 +00:00
|
|
|
{{- $page := .page }}
|
|
|
|
{{- /* default sort order for the theme is historically by weight */}}
|
|
|
|
{{- $by := .by }}
|
|
|
|
{{- if eq $by "auto" }}
|
|
|
|
{{- $by = "" }}
|
|
|
|
{{- end }}
|
|
|
|
{{- $by = $by | default $page.Params.ordersectionsby | default $page.Site.Params.ordersectionsby | default "weight" }}
|
|
|
|
|
|
|
|
{{- $pages := slice }}
|
|
|
|
|
|
|
|
{{- if eq $by "weight" }}
|
|
|
|
{{- $pages = $page.Pages.ByWeight }}
|
2024-10-24 22:10:32 +00:00
|
|
|
{{- else if or (eq $by "name") (eq $by "title") (eq $by "linktitle") }}
|
2023-10-12 21:08:58 +00:00
|
|
|
{{- $pages = $page.Pages.ByLinkTitle }}
|
|
|
|
{{- else if eq $by "modifieddate" }}
|
|
|
|
{{- $pages = $page.Pages.Lastmod }}
|
|
|
|
{{- else if eq $by "expirydate" }}
|
|
|
|
{{- $pages = $page.Pages.ByExpiryDate }}
|
|
|
|
{{- else if eq $by "publishdate" }}
|
|
|
|
{{- $pages = $page.Pages.ByPublishDate }}
|
|
|
|
{{- else if eq $by "date" }}
|
|
|
|
{{- $pages = $page.Pages.ByDate }}
|
|
|
|
{{- else if eq $by "length" }}
|
|
|
|
{{- $pages = $page.Pages.ByLength }}
|
|
|
|
{{- else if eq $by "default" }}
|
|
|
|
{{- $pages = $page.Pages }}
|
|
|
|
{{- else }}
|
2023-10-27 22:36:30 +00:00
|
|
|
{{- warnf "%q: Unknown pages sort order '%s'" $page.File.Filename }}
|
2023-10-12 21:08:58 +00:00
|
|
|
{{- $pages = $page.Pages }}
|
|
|
|
{{- end }}
|
|
|
|
|
2024-08-27 13:34:36 +00:00
|
|
|
{{- $filtered_pages := slice }}
|
|
|
|
{{- range $pages }}
|
2024-08-29 10:28:34 +00:00
|
|
|
{{- if not (partial "_relearn/pageIsSpecial.gotmpl" .) }}
|
2024-08-27 13:34:36 +00:00
|
|
|
{{- $filtered_pages = $filtered_pages | append . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- return $filtered_pages }}
|