hugo/hugolib/hugo.go
bep 3273fce044 Refactor Hugo version
Put version handling into the helpers package so it can be used by many,
and split version and suffix to make it possible to calculate the next Hugo version.
2015-03-18 12:23:13 +01:00

32 lines
576 B
Go

package hugolib
import (
"fmt"
"github.com/spf13/hugo/helpers"
"html/template"
)
var (
CommitHash string
BuildDate string
)
var hugoInfo *HugoInfo
// HugoInfo contains information about the current Hugo environment
type HugoInfo struct {
Version string
Generator template.HTML
CommitHash string
BuildDate string
}
func init() {
hugoInfo = &HugoInfo{
Version: helpers.HugoVersion(),
CommitHash: CommitHash,
BuildDate: BuildDate,
Generator: template.HTML(fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, helpers.HugoVersion())),
}
}