mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-21 02:31:38 +00:00
make the value of the BuildDrafts flag available to templates.This can be useful for if you only want to show some specific information on your local machine and/or when showing drafts.
This commit is contained in:
parent
7142374332
commit
a72ca38c07
1 changed files with 2 additions and 0 deletions
|
@ -92,6 +92,7 @@ type SiteInfo struct {
|
||||||
ConfigGet func(key string) interface{}
|
ConfigGet func(key string) interface{}
|
||||||
Permalinks PermalinkOverrides
|
Permalinks PermalinkOverrides
|
||||||
Params map[string]interface{}
|
Params map[string]interface{}
|
||||||
|
BuildDrafts bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SiteInfo) GetParam(key string) interface{} {
|
func (s *SiteInfo) GetParam(key string) interface{} {
|
||||||
|
@ -279,6 +280,7 @@ func (s *Site) initializeSiteInfo() {
|
||||||
LanguageCode: viper.GetString("languagecode"),
|
LanguageCode: viper.GetString("languagecode"),
|
||||||
Copyright: viper.GetString("copyright"),
|
Copyright: viper.GetString("copyright"),
|
||||||
DisqusShortname: viper.GetString("DisqusShortname"),
|
DisqusShortname: viper.GetString("DisqusShortname"),
|
||||||
|
BuildDrafts: viper.GetBool("BuildDrafts"),
|
||||||
Pages: &s.Pages,
|
Pages: &s.Pages,
|
||||||
Recent: &s.Pages,
|
Recent: &s.Pages,
|
||||||
Menus: &s.Menus,
|
Menus: &s.Menus,
|
||||||
|
|
Loading…
Reference in a new issue