{{- with .Paginator }}
{{- $currentPageNumber := .PageNumber }}
{{- with .First }}
{{- if ne $currentPageNumber .PageNumber }}
{{- else }}
{{- end }}
{{- end }}
{{- with .Prev }}
{{- else }}
{{- end }}
{{- $slots := 5 }}
{{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }}
{{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }}
{{- if lt (add (sub $end $start) 1) $slots }}
{{- $start = math.Max 1 (add (sub $end $slots) 1) }}
{{- end }}
{{- range $k := seq $start $end }}
{{- if eq $.Paginator.PageNumber $k }}
{{- else }}
{{- end }}
{{- end }}
{{- with .Next }}
{{- else }}
{{- end }}
{{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }}
{{- else }}
{{- end }}
{{- end }}
{{- end }}