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.