summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hugolib/hugo.go15
-rw-r--r--hugolib/node.go2
2 files changed, 7 insertions, 10 deletions
diff --git a/hugolib/hugo.go b/hugolib/hugo.go
index 3e4d02039..b90373b3c 100644
--- a/hugolib/hugo.go
+++ b/hugolib/hugo.go
@@ -17,14 +17,11 @@ type HugoInfo struct {
BuildDate string
}
-func getHugoInfo() *HugoInfo {
- if hugoInfo == nil {
- hugoInfo = &HugoInfo{
- Version: Version,
- CommitHash: CommitHash,
- BuildDate: BuildDate,
- Generator: `<meta name="generator" content="Hugo ` + Version + `" />`,
- }
+func init() {
+ hugoInfo = &HugoInfo{
+ Version: Version,
+ CommitHash: CommitHash,
+ BuildDate: BuildDate,
+ Generator: `<meta name="generator" content="Hugo ` + Version + `" />`,
}
- return hugoInfo
}
diff --git a/hugolib/node.go b/hugolib/node.go
index 85cf6aeb6..0c3ed9ce6 100644
--- a/hugolib/node.go
+++ b/hugolib/node.go
@@ -78,7 +78,7 @@ func (n *Node) IsMenuCurrent(menuId string, inme *MenuEntry) bool {
}
func (n *Node) Hugo() *HugoInfo {
- return getHugoInfo()
+ return hugoInfo
}
func (n *Node) isSameAsDescendantMenu(inme *MenuEntry, parent *MenuEntry) bool {