Added top level .Hugo variable with version, commit and generator information + docs

Added Version, CommitHash and BuildDate to hugolib/hugo.go and used it in build
Removed commitHash and buildDate from commands/version.go and used hugolib vars
Removed getDateFormat function from commands/version.go

Conflicts:
	README.md
	docs/content/templates/variables.md
This commit is contained in:
Derek Perkins
2014-12-09 08:36:07 -07:00
committed by bep
parent 90afe41e49
commit ac6b86aff8
7 changed files with 58 additions and 19 deletions

View File

@@ -67,6 +67,7 @@ type Site struct {
Taxonomies TaxonomyList
Source source.Input
Sections Taxonomy
Hugo HugoInfo
Info SiteInfo
Shortcodes map[string]ShortcodeFunc
Menus Menus
@@ -96,6 +97,7 @@ type SiteInfo struct {
Files []*source.File
Recent *Pages // legacy, should be identical to Pages
Menus *Menus
Hugo *HugoInfo
Title string
Author map[string]interface{}
LanguageCode string
@@ -339,6 +341,7 @@ func (s *Site) initialize() (err error) {
s.Menus = Menus{}
s.Hugo = NewHugoInfo()
s.initializeSiteInfo()
s.Shortcodes = make(map[string]ShortcodeFunc)
@@ -366,6 +369,7 @@ func (s *Site) initializeSiteInfo() {
Menus: &s.Menus,
Params: params,
Permalinks: permalinks,
Hugo: &s.Hugo,
}
}
@@ -1190,6 +1194,7 @@ func (s *Site) NewNode() *Node {
return &Node{
Data: make(map[string]interface{}),
Site: &s.Info,
Hugo: &s.Hugo,
}
}