-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Travis Beckham <[email protected]>
- Loading branch information
1 parent
eb40950
commit 129c1a0
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- /* This search index is used on docs.buoyant.io */ -}} | ||
{{- /* Resursively get all pages in the current top-level section */ -}} | ||
{{- $pages := where site.Pages "Section" "eq" .Section -}} | ||
[ | ||
{{- range $index, $page := $pages -}} | ||
{{- if gt $index 0 -}} , {{- end -}} | ||
{{- $ancestors := slice "linkerd.io" -}} | ||
{{- range .Ancestors.Reverse -}} | ||
{{- if .IsHome }}{{ continue }}{{ end -}} | ||
{{- $ancestors = $ancestors | append .Title -}} | ||
{{- end -}} | ||
{{- $entry := dict "uri" $page.Permalink -}} | ||
{{- $entry = merge $entry (dict "title" $page.Title) -}} | ||
{{- $entry = merge $entry (dict "ancestors" $ancestors) -}} | ||
{{- $entry = merge $entry (dict "content" ($page.Plain | htmlUnescape | truncate 3000)) -}} | ||
{{- $entry = merge $entry (dict "description" $page.Description) -}} | ||
{{- $entry = merge $entry (dict "keywords" $page.Keywords) -}} | ||
{{- $entry | jsonify -}} | ||
{{- end -}} | ||
] |