Skip to content

Commit

Permalink
Added search index for 2.15 docs
Browse files Browse the repository at this point in the history
Signed-off-by: Travis Beckham <[email protected]>
  • Loading branch information
travisbeckham committed May 16, 2024
1 parent eb40950 commit 129c1a0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions linkerd.io/layouts/2.15/section.json
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 -}}
]

0 comments on commit 129c1a0

Please sign in to comment.