From: Bjørn Erik Pedersen Date: Wed, 30 Sep 2015 03:43:11 +0000 (+0200) Subject: Use filepath as the last default sort key for pages X-Git-Tag: v0.15~146 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=dcd9c69a;p=brevno-suite%2Fhugo Use filepath as the last default sort key for pages --- diff --git a/hugolib/pageSort.go b/hugolib/pageSort.go index ec62ca7e..b536c233 100644 --- a/hugolib/pageSort.go +++ b/hugolib/pageSort.go @@ -43,6 +43,9 @@ func (by PageBy) Sort(pages Pages) { var DefaultPageSort = func(p1, p2 *Page) bool { if p1.Weight == p2.Weight { if p1.Date.Unix() == p2.Date.Unix() { + if p1.LinkTitle() == p2.LinkTitle() { + return (p1.FullFilePath() < p2.FullFilePath()) + } return (p1.LinkTitle() < p2.LinkTitle()) } return p1.Date.Unix() > p2.Date.Unix()