From: Bjørn Erik Pedersen Date: Mon, 9 Nov 2015 20:01:36 +0000 (+0100) Subject: Use Identifier as last sort resort for default menu sort X-Git-Tag: v0.15~77 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=570713a4;p=brevno-suite%2Fhugo Use Identifier as last sort resort for default menu sort Fixes #1562 --- diff --git a/hugolib/menu.go b/hugolib/menu.go index 322e9c7d..d7a72d4e 100644 --- a/hugolib/menu.go +++ b/hugolib/menu.go @@ -138,6 +138,9 @@ func (by MenuEntryBy) Sort(menu Menu) { var defaultMenuEntrySort = func(m1, m2 *MenuEntry) bool { if m1.Weight == m2.Weight { + if m1.Name == m2.Name { + return m1.Identifier < m2.Identifier + } return m1.Name < m2.Name } return m1.Weight < m2.Weight