1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

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

25
hugolib/hugo.go Normal file
View File

@@ -0,0 +1,25 @@
package hugolib
const Version = "0.13-DEV"
var (
CommitHash string
BuildDate string
)
// Hugo contains all the information about the current Hugo environment
type HugoInfo struct {
Version string
Generator string
CommitHash string
BuildDate string
}
func NewHugoInfo() HugoInfo {
return HugoInfo{
Version: Version,
CommitHash: CommitHash,
BuildDate: BuildDate,
Generator: `<meta name="generator" content="Hugo ` + Version + `" />`,
}
}