* 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
15 lines
487 B
JSON
15 lines
487 B
JSON
{{- $pages := partial "helper/pages.html" .Site.Home -}}
|
|
{{- $result := slice -}}
|
|
|
|
{{- range $pages -}}
|
|
{{- $data := dict "title" .Title "date" .Date "permalink" .RelPermalink "content" (.Plain) -}}
|
|
|
|
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources) -}}
|
|
{{- if $image -}}
|
|
{{- $data = merge $data (dict "image" $image.Permalink) -}}
|
|
{{- end -}}
|
|
|
|
{{- $result = $result | append $data -}}
|
|
{{- end -}}
|
|
|
|
{{ jsonify $result }} |