mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
28 lines
1.1 KiB
JSON
28 lines
1.1 KiB
JSON
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
|
{{- $pages := slice }}
|
|
{{- range .Site.Pages }}
|
|
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }}
|
|
{{- $title := .Title }}
|
|
{{- if eq .Kind "taxonomy" }}
|
|
{{- $title = i18n .Data.Plural }}
|
|
{{- if not $title }}
|
|
{{- $title = .Data.Plural }}
|
|
{{- end }}
|
|
{{- else if eq .Kind "term" }}
|
|
{{- $title = i18n .Data.Singular }}
|
|
{{- if not $title }}
|
|
{{- $title = .Data.Singular }}
|
|
{{- end }}
|
|
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default .Data.Term .Title) }}
|
|
{{- end }}
|
|
{{- $pages = $pages | append (dict
|
|
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
|
"title" $title
|
|
"tags" .Params.tags
|
|
"breadcrumb" (trim ((partial "breadcrumbs.html" (dict "page" . "dirOnly" true)) | plainify | htmlUnescape) "\n\r\t ")
|
|
"description" .Description
|
|
"content" (.Plain | htmlUnescape)
|
|
) }}
|
|
{{- end }}
|
|
{{- end -}}
|
|
{{- $pages | jsonify (dict "indent" " ") }}
|