2014-12-09 10:36:07 -05:00
|
|
|
package hugolib
|
|
|
|
|
|
|
|
const Version = "0.13-DEV"
|
|
|
|
|
|
|
|
var (
|
|
|
|
CommitHash string
|
|
|
|
BuildDate string
|
|
|
|
)
|
|
|
|
|
2015-01-18 20:53:07 -05:00
|
|
|
var hugoInfo *HugoInfo
|
|
|
|
|
2015-01-18 20:40:34 -05:00
|
|
|
// HugoInfo contains information about the current Hugo environment
|
2014-12-09 10:36:07 -05:00
|
|
|
type HugoInfo struct {
|
|
|
|
Version string
|
|
|
|
Generator string
|
|
|
|
CommitHash string
|
|
|
|
BuildDate string
|
|
|
|
}
|
|
|
|
|
2015-01-18 20:53:07 -05:00
|
|
|
func getHugoInfo() *HugoInfo {
|
|
|
|
if hugoInfo == nil {
|
|
|
|
hugoInfo = &HugoInfo{
|
|
|
|
Version: Version,
|
|
|
|
CommitHash: CommitHash,
|
|
|
|
BuildDate: BuildDate,
|
|
|
|
Generator: `<meta name="generator" content="Hugo ` + Version + `" />`,
|
|
|
|
}
|
2014-12-09 10:36:07 -05:00
|
|
|
}
|
2015-01-18 20:53:07 -05:00
|
|
|
return hugoInfo
|
2014-12-09 10:36:07 -05:00
|
|
|
}
|