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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user