Skip to content

Commit

Permalink
Merge branch 'main' into wm/versions
Browse files Browse the repository at this point in the history
  • Loading branch information
wmorgan committed Jun 5, 2024
2 parents 372c09b + 8258461 commit f0780b5
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions linkerd.io/layouts/index.searchindex.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{{- /* Ouput a json search index of all docs in the 2.15 section */ -}}
{{- $pages := where site.Pages "Section" "eq" "2.15" -}}
[
{{- 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 -}}
{{- $.Scratch.Add "search-index" slice -}}
{{- range $index, $page := $pages -}}
{{- $ancestors := slice "linkerd.io" -}}
{{- range $page.Ancestors.Reverse -}}
{{- if .IsHome }}{{ continue }}{{ end -}}
{{- $ancestors = $ancestors | append .Title -}}
{{- end -}}
]
{{- $.Scratch.Add
"search-index"
(dict
"uri" $page.Permalink
"title" $page.Title
"ancestors" $ancestors
"content" ($page.Plain | htmlUnescape | truncate 3000)
"description" $page.Description
"keywords" $page.Keywords
)
-}}
{{- end -}}
{{- $.Scratch.Get "search-index" | jsonify -}}

0 comments on commit f0780b5

Please sign in to comment.