{{ $pag := .Paginator }} {{- /* The minimum pages starting from the first page */ -}} {{ $minimumPage := .minimumPage | default 1 }} {{- /* The number of pages to be shown with the active page. */ -}} {{ $activeNumberOfPages := .activeNumberOfPages | default 2 }} {{- /* Since the active page is also included when adding the in-between pages of the active page, we need to increment it to mitigate against it. */ -}} {{ $midpointPages := add $activeNumberOfPages 1 }} {{ if gt $pag.TotalPages 1 -}}