Use filepath as the last default sort key for pages
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 30 Sep 2015 03:43:11 +0000 (05:43 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 30 Sep 2015 03:43:11 +0000 (05:43 +0200)
hugolib/pageSort.go

index ec62ca7e5dbf6330b7344ba5fd60e453a2b988a1..b536c2339cd84e9f2773eca26f0b51bb7f640eeb 100644 (file)
@@ -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()