hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 0e00ca6a6e94f30b0e5b6fcba3749029075a3462
parent bef496b97e1dc2df8c52b080152d539a58752801
Author: bep <bjorn.erik.pedersen@gmail.com>
Date:   Sun, 10 May 2015 15:23:36 +0200

Fix paginator with uglyurls

Fixes #1120

Diffstat:
Mhugolib/pagination.go | 3+++
Mhugolib/pagination_test.go | 1-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hugolib/pagination.go b/hugolib/pagination.go
@@ -23,6 +23,7 @@ import (
 	"math"
 	"path"
 	"reflect"
+	"strings"
 )
 
 type Pager struct {
@@ -268,6 +269,8 @@ func paginatePages(seq interface{}, pagerSize int, section string) (pagers, erro
 		return nil, err
 	}
 
+	section = strings.TrimSuffix(section, ".html")
+
 	urlFactory := newPaginationURLFactory(section)
 	paginator, _ := newPaginator(pages, pagerSize, urlFactory)
 	pagers := paginator.Pagers()
diff --git a/hugolib/pagination_test.go b/hugolib/pagination_test.go
@@ -172,7 +172,6 @@ func TestPaginate(t *testing.T) {
 }
 
 func doTestPaginate(t *testing.T, useViper bool) {
-
 	pagerSize := 5
 	if useViper {
 		viper.Set("paginate", pagerSize)