Skip to content

Commit

Permalink
fix: remove breadcrumbs parent
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-au committed Dec 27, 2022
1 parent ebf8987 commit b7cf272
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@
{{ $s := newScratch }}
{{ $s.Set "itemList" slice }}
{{ $s.Set "itemCount" 1 }}
{{ with .Parent }}
{{ partial "hugo-seo/private/params/breadcrumbs/parent-recursive" (dict "scratch" $s "parent" .) }}
{{ range .Ancestors.Reverse }}
{{ $title := .Params.seo.title | default .Title }}
{{ $s.Add "itemList" (slice (dict
"@type" "ListItem"
"item" .Permalink
"name" $title
"position" ($s.Get "itemCount")
))}}
{{ $s.Add "itemCount" 1 }}
{{ end }}
{{ $s.Add "itemList" (slice (dict
"@type" "ListItem"
"name" .Title
"position" ($s.Get "itemCount")
)) }}

{{ return dict "breadcrumbs" ($s.Get "itemList") }}
{{ return ($s.Get "itemList") }}

0 comments on commit b7cf272

Please sign in to comment.