{{- /* pagination.html (partial): This file is Hugo's default pagination template styled for Alpha theme. Features: - Navigational links for first/previous, next/last page with icons. - Numbered links for paginated pages Repo: https://github.com/oxypteros/alpha */ -}} {{- $validFormats := slice "default" "terse" }} {{- $msg1 := "When passing a map to the internal pagination template, one of the elements must be named 'page', and it must be set to the context of the current page." }} {{- $msg2 := "The 'format' specified in the map passed to the internal pagination template is invalid. Valid choices are: %s." }} {{- $page := . }} {{- $format := "default" }} {{- if reflect.IsMap . }} {{- with .page }} {{- $page = . }} {{- else }} {{- errorf $msg1 }} {{- end }} {{- with .format }} {{- $format = lower . }} {{- end }} {{- end }} {{- if in $validFormats $format }} {{- if gt $page.Paginator.TotalPages 1 }} {{- end }} {{- else }} {{- errorf $msg2 (delimit $validFormats ", ") }} {{- end -}} {{- /* Default format */}} {{- define "partials/inline/pagination/default" }} {{- with .Paginator }} {{- $currentPageNumber := .PageNumber }} {{- with .First }} {{- /* First left-enabled */}} {{- if ne $currentPageNumber .PageNumber }}