hugo-theme-relearn/assets/_relearn_searchindex.js
2024-10-11 16:45:42 +02:00

20 lines
1.1 KiB
JavaScript

{{- partialCached "relearn-meta.gotmpl" . .Path }}
{{- $pages := slice }}
{{- range .Site.Pages }}
{{- if partial "_relearn/pageIsSpecial.gotmpl" . }}
{{- else if and .Title .RelPermalink (or (ne .Site.Params.disableSearchHiddenPages true) (not (partialCached "_relearn/pageIsHiddenSelfOrAncestor.gotmpl" (dict "page" . "to" .Site.Home) .Path .Site.Home.Path) ) ) }}
{{- $tags := slice }}
{{- range .GetTerms "tags" }}
{{- $tags = $tags | append (partial "title.gotmpl" (dict "page" .Page "linkTitle" true) | plainify) }}
{{- end }}
{{- $pages = $pages | append (dict
"uri" (partial "permalink.gotmpl" (dict "to" .))
"title" (partial "title.gotmpl" (dict "page" .) | plainify)
"tags" $tags
"breadcrumb" (trim (partial "breadcrumbs.html" (dict "page" . "dirOnly" true) | plainify | htmlUnescape) "\n\r\t ")
"description" (trim (or .Description .Summary | plainify | htmlUnescape) "\n\r\t " )
"content" (trim (.Plain | htmlUnescape) "\n\r\t ")
) }}
{{- end }}
{{- end -}}
var relearn_searchindex = {{ $pages | jsonify (dict "indent" " ") }}