summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo.go
diff options
context:
space:
mode:
authorDerek Perkins <derek@derekperkins.com>2014-12-09 08:36:07 -0700
committerbep <bjorn.erik.pedersen@gmail.com>2015-01-19 01:22:23 +0100
commitac6b86aff8fe2ef8417c48074aadad6beea53052 (patch)
treee750cca04e36c3fc9c8ad5d62919aeb75b18417c /hugolib/hugo.go
parent90afe41e4943393a98a3f64409d7e8445c6a622d (diff)
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
Diffstat (limited to 'hugolib/hugo.go')
-rw-r--r--hugolib/hugo.go25
1 files changed, 25 insertions, 0 deletions
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: `<meta name="generator" content="Hugo ` + Version + `" />`,
+ }
+}