mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2026-04-03 14:26:17 +00:00
27 lines
705 B
HTML
27 lines
705 B
HTML
{{- $breadcrumb := false -}}
|
|
{{- $items := slice -}}
|
|
{{- if not .Params.disableBreadcrumb -}}
|
|
{{- range $index, $ancestor := .Ancestors.Reverse -}}
|
|
{{- $items = $items | append (dict
|
|
"@type" "ListItem"
|
|
"position" (add $index 1)
|
|
"name" $ancestor.Title
|
|
"item" $ancestor.Permalink
|
|
) -}}
|
|
{{- end -}}
|
|
{{- $items = $items | append (dict
|
|
"@type" "ListItem"
|
|
"position" (add (len $items) 1)
|
|
"name" .Title
|
|
"item" .Permalink
|
|
) -}}
|
|
{{- if gt (len $items) 1 -}}
|
|
{{- $breadcrumb = dict
|
|
"@type" "BreadcrumbList"
|
|
"@id" (printf "%s#breadcrumb" .Permalink)
|
|
"itemListElement" $items
|
|
-}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- return $breadcrumb -}}
|