From ac6b86aff8fe2ef8417c48074aadad6beea53052 Mon Sep 17 00:00:00 2001 From: Derek Perkins Date: Tue, 9 Dec 2014 08:36:07 -0700 Subject: 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 --- hugolib/hugo.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 hugolib/hugo.go (limited to 'hugolib/hugo.go') diff --git a/hugolib/hugo.go b/hugolib/hugo.go new file mode 100644 index 000000000..67c048dfa --- /dev/null +++ b/hugolib/hugo.go @@ -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: ``, + } +} -- cgit v1.2.3