Skip to content

Commit 74de324

Browse files
committed
Exclude pages using parameter search_ignore
1 parent a713b74 commit 74de324

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

assets/_relearn_searchindex.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- $pages := slice }}
2+
{{- range .Site.Pages }}
3+
{{- if or (partial "_relearn/pageIsSpecial.gotmpl" .) (.Params.search_ignore) }}
4+
{{- continue }}
5+
{{- 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) ) ) }}
6+
{{- $tags := slice }}
7+
{{- range .GetTerms "tags" }}
8+
{{- $tags = $tags | append (partial "title.gotmpl" (dict "page" .Page "linkTitle" true) | plainify) }}
9+
{{- end }}
10+
{{- $pages = $pages | append (dict
11+
"uri" (partial "permalink.gotmpl" (dict "to" .))
12+
"title" (partial "title.gotmpl" (dict "page" .) | plainify)
13+
"tags" $tags
14+
"breadcrumb" (trim (partial "breadcrumbs.html" (dict "page" . "dirOnly" true) | plainify | htmlUnescape) "\n\r\t ")
15+
"description" (trim (or .Description .Summary | plainify | htmlUnescape) "\n\r\t " )
16+
"content" (trim (.Plain | htmlUnescape) "\n\r\t ")
17+
) }}
18+
{{- end }}
19+
{{- end -}}
20+
var relearn_searchindex = {{ $pages | jsonify (dict "indent" " ") }}

0 commit comments

Comments
 (0)