summaryrefslogtreecommitdiffstats
path: root/hugolib/pagination.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-09-15 09:32:52 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-09-15 09:32:52 +0200
commitb86a605bfb14450d56f4e7faeb4fc5fa8c936438 (patch)
tree5fc32bce53a880a706ef28b2041081995693894e /hugolib/pagination.go
parentbbb11a4a0f9b4673ecba52d349e90db8c352e444 (diff)
Make paginate settings configurable per language
Fixes #2449
Diffstat (limited to 'hugolib/pagination.go')
-rw-r--r--hugolib/pagination.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/hugolib/pagination.go b/hugolib/pagination.go
index f7f9cbf8c..5bba5d89f 100644
--- a/hugolib/pagination.go
+++ b/hugolib/pagination.go
@@ -24,7 +24,6 @@ import (
"github.com/spf13/cast"
"github.com/spf13/hugo/helpers"
- "github.com/spf13/viper"
)
// Pager represents one of the elements in a paginator.
@@ -358,7 +357,7 @@ func (n *Node) Paginate(seq interface{}, options ...interface{}) (*Pager, error)
func resolvePagerSize(options ...interface{}) (int, error) {
if len(options) == 0 {
- return viper.GetInt("paginate"), nil
+ return helpers.Config().GetInt("paginate"), nil
}
if len(options) > 1 {
@@ -509,7 +508,7 @@ func newPaginator(elements []paginatedElement, total, size int, urlFactory pagin
}
func newPaginationURLFactory(pathElements ...string) paginationURLFactory {
- paginatePath := viper.GetString("paginatePath")
+ paginatePath := helpers.Config().GetString("paginatePath")
return func(page int) string {
var rel string