{{- $paginator := . -}} {{- if gt $paginator.TotalPages 1 -}} {{- $pageIndex := $paginator.PageNumber -}} {{- $totalPages := $paginator.TotalPages -}} {{- $cols := 5.0 -}} {{- $rows := math.Ceil (div $totalPages $cols) -}} {{- $row := math.Ceil (div $pageIndex $cols) -}} {{- $startPage := sub (mul $row $cols) $cols -}} {{- $endPage := add $startPage $cols -}}