diff options
author | Bjørn Erik Pedersen <[email protected]> | 2018-11-26 10:11:22 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-12-06 14:37:25 +0100 |
commit | 831d23cb4d1ca99cdc15ed31c8ee1f981497be8f (patch) | |
tree | 8fe47b1b1b9233448297f8015ce61bbb7da13fc7 /transform | |
parent | 514e18dc27ce37a0e9a231741d616cf29d50d610 (diff) | |
download | hugo-831d23cb4d1ca99cdc15ed31c8ee1f981497be8f.tar.gz hugo-831d23cb4d1ca99cdc15ed31c8ee1f981497be8f.zip |
Add tpl/site and tpl/hugo
This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc.
Fixes #5470
Fixes #5467
Fixes #5503
Diffstat (limited to 'transform')
-rw-r--r-- | transform/metainject/hugogenerator.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/transform/metainject/hugogenerator.go b/transform/metainject/hugogenerator.go index 513b21228..5f3a8f63b 100644 --- a/transform/metainject/hugogenerator.go +++ b/transform/metainject/hugogenerator.go @@ -18,12 +18,13 @@ import ( "fmt" "regexp" + "github.com/gohugoio/hugo/common/hugo" "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/transform" ) var metaTagsCheck = regexp.MustCompile(`(?i)<meta\s+name=['|"]?generator['|"]?`) -var hugoGeneratorTag = fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, helpers.CurrentHugoVersion) +var hugoGeneratorTag = fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, hugo.CurrentVersion) // HugoGenerator injects a meta generator tag for Hugo if none present. func HugoGenerator(ft transform.FromTo) error { |