mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-30 01:03:21 -05:00
parent
bef496b97e
commit
0e00ca6a6e
2 changed files with 3 additions and 1 deletions
|
@ -23,6 +23,7 @@ import (
|
||||||
"math"
|
"math"
|
||||||
"path"
|
"path"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Pager struct {
|
type Pager struct {
|
||||||
|
@ -268,6 +269,8 @@ func paginatePages(seq interface{}, pagerSize int, section string) (pagers, erro
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
section = strings.TrimSuffix(section, ".html")
|
||||||
|
|
||||||
urlFactory := newPaginationURLFactory(section)
|
urlFactory := newPaginationURLFactory(section)
|
||||||
paginator, _ := newPaginator(pages, pagerSize, urlFactory)
|
paginator, _ := newPaginator(pages, pagerSize, urlFactory)
|
||||||
pagers := paginator.Pagers()
|
pagers := paginator.Pagers()
|
||||||
|
|
|
@ -172,7 +172,6 @@ func TestPaginate(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func doTestPaginate(t *testing.T, useViper bool) {
|
func doTestPaginate(t *testing.T, useViper bool) {
|
||||||
|
|
||||||
pagerSize := 5
|
pagerSize := 5
|
||||||
if useViper {
|
if useViper {
|
||||||
viper.Set("paginate", pagerSize)
|
viper.Set("paginate", pagerSize)
|
||||||
|
|
Loading…
Reference in a new issue