mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
64b4ad751e
- description - title - tags
21 lines
1.2 KiB
JavaScript
21 lines
1.2 KiB
JavaScript
{{- partialCached "page-meta.hugo" . .RelPermalink }}
|
|
{{- $format := partial "get-format.hugo" . }}
|
|
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
|
{{- $pages := slice }}
|
|
{{- range .Site.Pages }}
|
|
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }}
|
|
{{- $tags := slice }}
|
|
{{- range .GetTerms "tags" }}
|
|
{{- $tags = $tags | append (partial "pageHelper/title.hugo" (dict "page" .Page "linkTitle" true "format" $format "outputFormat" $outputFormat) | plainify) }}
|
|
{{- end }}
|
|
{{- $pages = $pages | append (dict
|
|
"uri" (partial "relLangPrettyUglyURL.hugo" (dict "to" .))
|
|
"title" (partial "pageHelper/title.hugo" (dict "page" . "format" $format "outputFormat" $outputFormat) | plainify)
|
|
"tags" $tags
|
|
"breadcrumb" (partial "breadcrumbs.html" (dict "page" . "dirOnly" true) | plainify | htmlUnescape | chomp)
|
|
"description" (or .Description .Summary | plainify | htmlUnescape | chomp)
|
|
"content" (.Plain | htmlUnescape | chomp)
|
|
) }}
|
|
{{- end }}
|
|
{{- end -}}
|
|
var relearn_search_index = {{ $pages | jsonify (dict "indent" " ") }}
|