hugolib: Avoid repeated Viper loads of sectionPagesMenu

See #2728
This commit is contained in:
Bjørn Erik Pedersen
2016-11-23 22:06:15 +01:00
parent dbb0c1cfc9
commit 1f6e0de361
2 changed files with 4 additions and 2 deletions

View File

@@ -1092,7 +1092,7 @@ func (p *Page) getParam(key string, stringToLower bool) interface{} {
func (p *Page) HasMenuCurrent(menuID string, me *MenuEntry) bool {
sectionPagesMenu := helpers.Config().GetString("SectionPagesMenu")
sectionPagesMenu := p.Site.sectionPagesMenu
// page is labeled as "shadow-member" of the menu with the same identifier as the section
if sectionPagesMenu != "" && p.Section() != "" && sectionPagesMenu == menuID && p.Section() == me.Identifier {