Hello Nice people, I want to use pagination by calling a partial. But I can’t figure out how to do it. This is what I have done, and the result showing empty/nill.
Calling the partial:
{{ partial "blog.html" (dict "Paging" true ) }}
This is the blog partial:
{{ $paginator := site.RegularPages }}
{{ if .Paging }}
{{ $paginator = (.Page.Paginate $paginator).Pages }}
{{ end }}
{{ range $paginator }}
{{ .Title }}
{{ end }}
The DOT in your partial has only .Paging available, not .Page.Paginate. You don’t give the context over to the partial. You need to call the partial like this: