I’m trying to use a shortcode to list posts matching a certain query,and the following works:
{{ $posts := (where $.Site.Pages ".Params.article_source" "in" (.Get "sources") ) }}
{{ range $posts }}
{{ .Render "summary" }}
{{ end }}
But it breaks when I try to add pagination:
{{ $posts := (where $.Site.Pages ".Params.article_source" "in" (.Get "sources") ) }}
{{ $paginator := (.Paginate $posts) }}
{{ range $paginator.pages }}
{{ .Render "summary" }}
{{ end }}
Error: Error building site: "/Users/brunoamaral/Labs/gregory/content/physicaltherapists/index.md:55:1": failed to render shortcode "list-by": failed to process shortcode: "/Users/brunoamaral/Labs/gregory/layouts/shortcodes/list-by.html:2:18": execute of template failed: template: shortcodes/list-by.html:2:18: executing "shortcodes/list-by.html" at <.Paginate>: can't evaluate field Paginate in type *hugolib.ShortcodeWithPage
Is this even possible or am I barking up the wrong tree ?