ref: 0e00ca6a6e94f30b0e5b6fcba3749029075a3462
parent: bef496b97e1dc2df8c52b080152d539a58752801
author: bep <[email protected]>
date: Sun May 10 11:23:36 EDT 2015
Fix paginator with uglyurls Fixes #1120
--- a/hugolib/pagination.go
+++ b/hugolib/pagination.go
@@ -23,6 +23,7 @@
"math"
"path"
"reflect"
+ "strings"
)
type Pager struct {
@@ -267,6 +268,8 @@
if err != nil {
return nil, err
}
+
+ section = strings.TrimSuffix(section, ".html")
urlFactory := newPaginationURLFactory(section)
paginator, _ := newPaginator(pages, pagerSize, urlFactory)
--- a/hugolib/pagination_test.go
+++ b/hugolib/pagination_test.go
@@ -172,7 +172,6 @@
}
func doTestPaginate(t *testing.T, useViper bool) {
-
pagerSize := 5
if useViper {
viper.Set("paginate", pagerSize)