{{- /* pagination.tmpl ~ Pagination navigation for html3. */ -}} {{- /* white space are preserved and is used for formatting */}} {{- define "pagination" -}} {{- $navi := index . "navigate" }} {{- $c := $navi.Current }} {{- $p := $navi.Page }} {{- $m := $navi.PageMax }} {{- $q := $navi.QueryStr }} {{- $l1 := $navi.Link1 }} {{- $l2 := $navi.Link2 }} {{- $l3 := $navi.Link3 }} {{- if gt ($navi.Limit) 0 }} {{- if gt $m 1 -}}

{{- if eq $p 1 -}} < {{- else -}} < {{- end -}} {{- if eq $p 1 }} 1 {{- else }} 1 {{- end -}} {{- if gt $m 5}} … {{end}} {{- if gt (index $navi.Link1) 0 }} {{- if eq $l1 $p }}{{$l1}}{{else}}{{$l1}}{{end}} {{end}} {{- if gt (index $navi.Link2) 0 }} {{- if eq $l2 $p }}{{$l2}}{{else}}{{$l2}}{{end}} {{end}} {{- if gt (index $navi.Link3) 0 }} {{- if eq $l3 $p }}{{$l3}}{{else}}{{$l3}}{{end}} {{end}} {{- if gt $m 5}} … {{end}} {{- if eq ($p) ($m) -}} {{$m}} {{- else -}} {{$m}} {{- end -}} {{- if ge ($p) ($navi.PageNext)}} > {{- else}} > {{- end}}

{{ end -}}{{ end -}}{{ end -}}