1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

Fix buggy Pages.Limit

Also add missing page sort related tests.
This commit is contained in:
Bjørn Erik Pedersen
2016-02-06 22:10:36 +01:00
parent b21d280c67
commit 88a320fb2d
2 changed files with 53 additions and 7 deletions

View File

@@ -64,7 +64,7 @@ func (p Pages) Sort() {
}
func (p Pages) Limit(n int) Pages {
if len(p) < n {
if len(p) > n {
return p[0:n]
}
return p