aboutsummaryrefslogtreecommitdiffhomepage
path: root/transform
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2016-07-06 23:23:44 +0200
committerBjørn Erik Pedersen <[email protected]>2016-07-06 23:23:44 +0200
commit223073c6fdf1258de41782f96444ac81f32e9235 (patch)
tree51002a8685db839f4b77024b36ce8e71bc9d9995 /transform
parent39fe42cf6b0032712e2fa97f86accd4a29ad9d24 (diff)
downloadhugo-223073c6fdf1258de41782f96444ac81f32e9235.tar.gz
hugo-223073c6fdf1258de41782f96444ac81f32e9235.zip
transform: Add missing GoDoc
Diffstat (limited to 'transform')
-rw-r--r--transform/chain.go5
-rw-r--r--transform/hugogeneratorinject.go1
2 files changed, 5 insertions, 1 deletions
diff --git a/transform/chain.go b/transform/chain.go
index b566f54fa..7be38ccaa 100644
--- a/transform/chain.go
+++ b/transform/chain.go
@@ -15,8 +15,9 @@ package transform
import (
"bytes"
- bp "github.com/spf13/hugo/bufferpool"
"io"
+
+ bp "github.com/spf13/hugo/bufferpool"
)
type trans func(rw contentTransformer)
@@ -25,10 +26,12 @@ type link trans
type chain []link
+// NewChain creates a chained content transformer given the provided transforms.
func NewChain(trs ...link) chain {
return trs
}
+// NewEmptyTransforms creates a new slice of transforms with a capacity of 20.
func NewEmptyTransforms() []link {
return make([]link, 0, 20)
}
diff --git a/transform/hugogeneratorinject.go b/transform/hugogeneratorinject.go
index fe82a2eaf..a73227de7 100644
--- a/transform/hugogeneratorinject.go
+++ b/transform/hugogeneratorinject.go
@@ -24,6 +24,7 @@ import (
var metaTagsCheck = regexp.MustCompile(`(?i)<meta\s+name=['|"]?generator['|"]?`)
var hugoGeneratorTag = fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, helpers.HugoVersion())
+// HugoGeneratorInject injects a meta generator tag for Hugo if none present.
func HugoGeneratorInject(ct contentTransformer) {
if metaTagsCheck.Match(ct.Content()) {
ct.Write(ct.Content())