Fix pagination on writeups

This commit is contained in:
2021-11-30 23:18:43 +01:00
parent d6544b95cf
commit 7178e45413
4 changed files with 6 additions and 15 deletions
+4 -5
View File
@@ -210,16 +210,15 @@
{{- end }}
{{- end }}
"description": {{ .Params.description | plainify }}
}{{ end }}{{ if .IsSection }},
}{{ end }}{{ if or .IsSection (or (eq .Kind "term") (eq .Kind "taxonomy")) }},
{
"@context": "http://schema.org",
"@type": "ItemList",
"itemListOrder": "https://schema.org/ItemListOrderDescending",
"name": "{{ .Title }}",
"numberOfItems": {{ len .Data.Pages }},
"numberOfItems": {{ .Paginator.TotalNumberOfElements }},
"itemListElement": [
{{- $pages := first 10 .Data.Pages }}
{{- range $index, $page := $pages }}
{{- range $index, $page := .Paginator.Pages }}
{
"@type": "ListItem",
"position": {{ add $index 1 }},
@@ -283,7 +282,7 @@
{{- end }}
"description": {{ .Params.description | plainify }}
}
}{{ if ne (sub (len $pages) 1) $index }},{{ end }}
}{{ if ne $index (sub $.Paginator.NumberOfElements 1) }},{{ end }}
{{- end }}
]
}{{ end }}