2014-12-09 15:36:07 +00:00
|
|
|
package hugolib
|
|
|
|
|
2015-01-19 07:26:06 +00:00
|
|
|
import (
|
2015-03-18 11:23:13 +00:00
|
|
|
"fmt"
|
|
|
|
"github.com/spf13/hugo/helpers"
|
2015-01-19 07:26:06 +00:00
|
|
|
"html/template"
|
|
|
|
)
|
|
|
|
|
2014-12-09 15:36:07 +00:00
|
|
|
var (
|
|
|
|
CommitHash string
|
|
|
|
BuildDate string
|
|
|
|
)
|
|
|
|
|
2015-01-19 01:53:07 +00:00
|
|
|
var hugoInfo *HugoInfo
|
|
|
|
|
2015-01-19 01:40:34 +00:00
|
|
|
// HugoInfo contains information about the current Hugo environment
|
2014-12-09 15:36:07 +00:00
|
|
|
type HugoInfo struct {
|
|
|
|
Version string
|
2015-01-19 07:26:06 +00:00
|
|
|
Generator template.HTML
|
2014-12-09 15:36:07 +00:00
|
|
|
CommitHash string
|
|
|
|
BuildDate string
|
|
|
|
}
|
|
|
|
|
2015-01-19 02:06:07 +00:00
|
|
|
func init() {
|
|
|
|
hugoInfo = &HugoInfo{
|
2015-03-18 11:23:13 +00:00
|
|
|
Version: helpers.HugoVersion(),
|
2015-01-19 02:06:07 +00:00
|
|
|
CommitHash: CommitHash,
|
|
|
|
BuildDate: BuildDate,
|
2015-03-18 11:23:13 +00:00
|
|
|
Generator: template.HTML(fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, helpers.HugoVersion())),
|
2014-12-09 15:36:07 +00:00
|
|
|
}
|
|
|
|
}
|