Hello, i was trying to apply Canonical Pagination Links for Blog Posts and Tags using this
{{ $href := .Permalink }}
{{ with $paginator }}
{{ if gt .PageNumber 1 }}
{{ $href = printf "%s%s/%d/" $.Permalink "page" .PageNumber }}
{{ end }}
{{ end }}
<link rel="canonical" href="{{ $href }}">
but it keeps giving me this error ( undefined variable “$paginator” )