ref: a72ca38c07f5acd55f29b112afa3cd9830ba4cc4
parent: 7142374332605a0d873bbab302767f3f154ec44c
author: Nate Finch <[email protected]>
date: Wed Sep 10 18:34:00 EDT 2014
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.
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -92,6 +92,7 @@
ConfigGet func(key string) interface{}
Permalinks PermalinkOverrides
Params map[string]interface{}
+ BuildDrafts bool
}
func (s *SiteInfo) GetParam(key string) interface{} {
@@ -279,6 +280,7 @@
LanguageCode: viper.GetString("languagecode"),
Copyright: viper.GetString("copyright"),
DisqusShortname: viper.GetString("DisqusShortname"),
+ BuildDrafts: viper.GetBool("BuildDrafts"),
Pages: &s.Pages,
Recent: &s.Pages,
Menus: &s.Menus,