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. - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit a72ca38c07f5acd55f29b112afa3cd9830ba4cc4
DIR parent 7142374332605a0d873bbab302767f3f154ec44c
HTML Author: Nate Finch <nate.finch@gmail.com>
Date: Wed, 10 Sep 2014 22:34:00 -0400
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.
Diffstat:
M hugolib/site.go | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
---
DIR diff --git a/hugolib/site.go b/hugolib/site.go
@@ -92,6 +92,7 @@ type SiteInfo struct {
ConfigGet func(key string) interface{}
Permalinks PermalinkOverrides
Params map[string]interface{}
+ BuildDrafts bool
}
func (s *SiteInfo) GetParam(key string) interface{} {
@@ -279,6 +280,7 @@ func (s *Site) initializeSiteInfo() {
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,