shithub: hugo

ref: 7257ab6855df7c5c0a1614daee39bdc684ae8056
dir: /hugolib/hugo.go/

View raw version
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
}