Calling two 'paginators' once per page in `baseof.html`

Since .Paginate can only be called once per page, I would like to have two instances of them. One for the homepage, and one for the section pages, both called from baseof.html (I will use the $paginator in </head></head> for canonical URL for paginated pages and in the main body for sorting and paginating articles)

Adding the paginator code ($paginator := .Paginate (where site.RegularPages "Type" "post" }}) in the baseof.html and then ranging $paginator in the index.html for example, throws an error that $paginator is no defined or the instance inside the <head></head> says .PageNumber is not defined. No build errors occur if I create a complete index file <!doctype html>...</html> and place the $paginator code at the very top just before the opening </head> tag. I want to resolve this issue while maintaining ‘lean’ code that the baseof.html provides.

Apparently, this is not possible.

Yes, it is possible, you just need to think about it in a different way. See:
https://discourse.gohugo.io/t/define-params-in-baseof-html/37643/8

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.