diff options
Diffstat (limited to 'transform')
-rw-r--r-- | transform/hugogeneratorinject.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/transform/hugogeneratorinject.go b/transform/hugogeneratorinject.go index a73227de7..4c37a058d 100644 --- a/transform/hugogeneratorinject.go +++ b/transform/hugogeneratorinject.go @@ -27,7 +27,9 @@ var hugoGeneratorTag = fmt.Sprintf(`<meta name="generator" content="Hugo %s" />` // HugoGeneratorInject injects a meta generator tag for Hugo if none present. func HugoGeneratorInject(ct contentTransformer) { if metaTagsCheck.Match(ct.Content()) { - ct.Write(ct.Content()) + if _, err := ct.Write(ct.Content()); err != nil { + helpers.DistinctWarnLog.Println("Failed to inject Hugo generator tag:", err) + } return } @@ -41,5 +43,8 @@ func HugoGeneratorInject(ct contentTransformer) { newcontent = bytes.Replace(ct.Content(), []byte(head), replace, 1) } - ct.Write(newcontent) + if _, err := ct.Write(newcontent); err != nil { + helpers.DistinctWarnLog.Println("Failed to inject Hugo generator tag:", err) + } + } |