mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 17:40:50 +00:00
3273fce044
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.
31 lines
576 B
Go
31 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())),
|
|
}
|
|
}
|