summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo.go
blob: 3e4d02039660ee4e0ccf6559ac3846eb4b4ece29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package hugolib

const Version = "0.13-DEV"

var (
	CommitHash string
	BuildDate  string
)

var hugoInfo *HugoInfo

// HugoInfo contains information about the current Hugo environment
type HugoInfo struct {
	Version    string
	Generator  string
	CommitHash string
	BuildDate  string
}

func getHugoInfo() *HugoInfo {
	if hugoInfo == nil {
		hugoInfo = &HugoInfo{
			Version:    Version,
			CommitHash: CommitHash,
			BuildDate:  BuildDate,
			Generator:  `<meta name="generator" content="Hugo ` + Version + `" />`,
		}
	}
	return hugoInfo
}