diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-11-07 08:36:35 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-11-07 10:38:58 +0100 |
commit | 3a44920e79ef86003555d8a4860c29257b2914f0 (patch) | |
tree | 81f1c2992eb83f1c28c037f6263be7f4042eaa72 /hugolib | |
parent | 79a06aa4b64b526c242dfa41f2c7bc24e1352d5b (diff) |
hugolib: Improve error message on duplicate menu items
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/site.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index 761d4a6bd..fb32853e3 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -28,6 +28,8 @@ import ( "strings" "time" + "github.com/pkg/errors" + "github.com/gohugoio/hugo/common/text" "github.com/gohugoio/hugo/hugofs" @@ -1438,7 +1440,7 @@ func (s *Site) assembleMenus() { for _, p := range pages { for name, me := range p.Menus() { if _, ok := flat[twoD{name, me.KeyName()}]; ok { - s.Log.ERROR.Printf("Two or more menu items have the same name/identifier in Menu %q: %q.\nRename or set an unique identifier.\n", name, me.KeyName()) + s.SendError(p.errWithFileContext(errors.Errorf("duplicate menu entry with identifier %q in menu %q", me.KeyName(), name))) continue } flat[twoD{name, me.KeyName()}] = me |