Skip to content

Commit

Permalink
introduce searchHidden front-matter var
Browse files Browse the repository at this point in the history
- to hide particular pages from search

usage:
in page's front-matter add
searchHidden: true
  • Loading branch information
adityatelange committed Jan 30, 2021
1 parent 6c79b99 commit 0c28a4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion layouts/_default/index.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- if not .Params.searchHidden }}
{{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}}
{{- end }}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

0 comments on commit 0c28a4a

Please sign in to comment.