{{- with .Paginator }} {{- $width := $.Site.Params.list.paginationWidth | default 1 }} {{- $currentPageNumber := .PageNumber }} {{- if gt .TotalPages 1 }} {{- $start := math.Max 1 (sub .PageNumber $width) }} {{- $end := math.Min .TotalPages (add $start (mul $width 2)) }}