blob: 34a740cfd8af812d8f88e2f665e60833081a41fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
[
{{- range $index, $page := where .Site.RegularPages "Section" "in" .Site.Params.mainSections -}}
{{- if gt $index 0 -}}
,
{{- end -}}
{{- $rawTitle := (partial "utils/title.html" (dict "$" $ "title" $page.Title)).rawTitle -}}
{{- $entry := dict "uri" $page.RelPermalink "title" $rawTitle "content" ($page.Plain | htmlUnescape) -}}
{{- if $page.Params.subtitle -}}
{{- $subtitle := partial "utils/markdownify.html" (dict "$" $page "raw" $page.Params.subtitle "isContent" false) -}}
{{- $entry = merge $entry (dict "subtitle" ($subtitle | plainify | htmlUnescape)) -}}
{{- end -}}
{{- if .Site.Params.displayPostDescription -}}
{{- $description := partial "utils/markdownify.html" (dict "$" $page "raw" $page.Description "isContent" false) -}}
{{- $entry = merge $entry (dict "description" ($description | plainify | htmlUnescape)) -}}
{{- end -}}
{{- if .Site.Params.displayCategory -}}
{{- if eq .Site.Params.categoryBy "sections" -}}
{{- $entry = merge $entry (dict "categories" (slice $page.Section)) -}}
{{- else if eq .Site.Params.categoryBy "categories" -}}
{{- $entry = merge $entry (dict "categories" $page.Params.categories) -}}
{{- end -}}
{{- end -}}
{{- if .Site.Params.enablePostTags -}}
{{- $entry = merge $entry (dict "tags" $page.Params.tags) -}}
{{- end -}}
{{- $entry | jsonify -}}
{{- end -}}
]
|