Accessing partial variables in template

You need to attach this pagination on your page context using .Scratch. Then as you are passing this page context to your pagination.html partial, you will be able to get it from there.

{{ .Scratch.Set "pagination" $paginator }}
{{ partial "pagination.html" . }}

Then from layouts/partial/pagination.html

{{ .Scratch.Get "pagination" }}