* refactor: migrate page visibility control from `Params.hidden` to the new `build.list` parameter. * refactor: centralize page filtering logic into a new `helper/pages.html` partial * feat: introduce `SortBy` parameter to enable sorting pages by last modified date * refactor: extract page sorting logic into a new `pages-sort.html` partial
7 lines
158 B
HTML
7 lines
158 B
HTML
{{- $pages := .Pages -}}
|
|
|
|
{{- if eq .Context.Site.Params.SortBy "lastmod" -}}
|
|
{{- $pages = $pages.ByLastmod.Reverse -}}
|
|
{{- end -}}
|
|
|
|
{{- return $pages -}} |