mirror of
https://github.com/docker/docs.git
synced 2026-03-27 06:18:55 +07:00
site: show breadcrumbs in search results
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{{- $description := partial "utils/description.html" . -}}
|
||||
{{- $keywords := partialCached "utils/keywords.html" . . -}}
|
||||
{{- $breadcrumbs := slice -}}
|
||||
{{- range .Ancestors.Reverse -}}
|
||||
{{- range after 1 .Ancestors.Reverse -}}
|
||||
{{- $breadcrumbs = $breadcrumbs | append .LinkTitle -}}
|
||||
{{- end -}}
|
||||
{{- with $description }}<meta data-pagefind-meta="description:{{ . }}">{{ end }}
|
||||
|
||||
@@ -46,6 +46,9 @@
|
||||
<pagefind-results>
|
||||
<script type="text/pagefind-template">
|
||||
<li class="py-3 border-b border-gray-200 dark:border-gray-700 last:border-b-0">
|
||||
{{ print "{{#if meta.breadcrumbs}}" }}
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 mb-1">{{ print "{{ meta.breadcrumbs }}" }}</p>
|
||||
{{ print "{{/if}}" }}
|
||||
<p class="font-medium">
|
||||
<a class="text-blue-600 dark:text-blue-400 hover:underline" href="{{ print "{{ meta.url | default(url) | safeUrl }}" }}">
|
||||
{{ print "{{ meta.title }}" }}
|
||||
|
||||
Reference in New Issue
Block a user