mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2025-05-19 09:25:09 -04:00
Merge 05ba5a763f
into 7cf752f864
This commit is contained in:
commit
aead8be703
1 changed files with 5 additions and 3 deletions
|
@ -25,6 +25,7 @@
|
|||
{{- $url := replace .Parent.Permalink ( printf "%s" site.Home.Permalink) "" }}
|
||||
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
|
||||
{{- $bc_list := (split $lang_url "/")}}
|
||||
{{- $position := 0 }}
|
||||
|
||||
{{- $scratch := newScratch }}
|
||||
<script type="application/ld+json">
|
||||
|
@ -38,10 +39,11 @@
|
|||
{{- $bc_pg := site.GetPage ($scratch.Get "path") -}}
|
||||
|
||||
{{- if (and ($bc_pg) (gt (len . ) 0))}}
|
||||
{{- $position = add 1 $position }}
|
||||
{{- if (and $index)}}, {{end }}
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": {{ add 1 $index }},
|
||||
"position": {{ $position }},
|
||||
"name": {{ $bc_pg.Name }},
|
||||
"item": {{ $bc_pg.Permalink | safeHTML }}
|
||||
}
|
||||
|
@ -49,10 +51,10 @@
|
|||
|
||||
{{- end }}
|
||||
{{- /* self-page addition */ -}}
|
||||
{{- if (ge (len $bc_list) 2) }}, {{end }}
|
||||
{{- if (gt $position 0) }}, {{end }}
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": {{len $bc_list}},
|
||||
"position": {{ add 1 $position }},
|
||||
"name": {{ .Name }},
|
||||
"item": {{ .Permalink | safeHTML }}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue