diff options
-rw-r--r-- | hugolib/page.go | 2 | ||||
-rw-r--r-- | hugolib/site.go | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index 583ff8ba4..883d70c43 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -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 { diff --git a/hugolib/site.go b/hugolib/site.go index 0c37b3882..01539bccc 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -191,6 +191,7 @@ type SiteInfo struct { LanguagePrefix string Languages helpers.Languages defaultContentLanguageInSubdir bool + sectionPagesMenu string pathSpec *helpers.PathSpec } @@ -937,6 +938,7 @@ func (s *Site) initializeSiteInfo() { LanguagePrefix: languagePrefix, Languages: languages, defaultContentLanguageInSubdir: defaultContentInSubDir, + sectionPagesMenu: lang.GetString("sectionPagesMenu"), GoogleAnalytics: lang.GetString("googleAnalytics"), BuildDrafts: viper.GetBool("buildDrafts"), canonifyURLs: viper.GetBool("canonifyURLs"), @@ -1412,7 +1414,7 @@ func (s *Site) assembleMenus() { } } - sectionPagesMenu := s.Language.GetString("sectionPagesMenu") + sectionPagesMenu := s.Info.sectionPagesMenu sectionPagesMenus := make(map[string]interface{}) //creating flat hash pages := s.Pages |