{{- $validFormats := slice "default" "terse" }} {{- $validAlignments := slice "begin" "center" "end" }} {{- $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." }} {{- $msg3 := "The 'align' specified in the map passed to the internal pagination template is invalid. Valid choices are: %s." }} {{- $page := . }} {{- $format := "default" }} {{- $align := "begin" }} {{- if reflect.IsMap . }} {{- with .page }} {{- $page = . }} {{- else }} {{- errorf $msg1 }} {{- end }} {{- with .format }} {{- $format = lower . }} {{- end }} {{- with .align }} {{- $align = lower . }} {{- end }} {{- end }} {{- $alignments := (dict "left" "" "center" "justify-content-center" "end" "justify-content-end") }} {{- if not (in $validFormats $format) }} {{- errorf $msg2 (delimit $validFormats ", ") }} {{- else if not (in $validFormats $format) }} {{- errorf $msg3 (delimit $validAlignments ", ") }} {{- else }} {{- if gt $page.Paginator.TotalPages 1 }}