mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2026-04-10 17:56:10 +00:00
seo/geo
This commit is contained in:
26
layouts/partials/utils/breadcrumb-schema-object.html
Normal file
26
layouts/partials/utils/breadcrumb-schema-object.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- $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 -}}
|
||||
Reference in New Issue
Block a user