aboutsummaryrefslogtreecommitdiffhomepage
path: root/transform
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2016-02-06 19:22:12 +0100
committerBjørn Erik Pedersen <[email protected]>2016-02-06 19:22:12 +0100
commit08b582e18730d44111203e28e761c5c7c07062bf (patch)
treef94ff90fcff28c1434e26c3a032a1f3a749ea0ff /transform
parentdd1db334ac15f3bdb67b40973668d1d7b9ca7f08 (diff)
downloadhugo-08b582e18730d44111203e28e761c5c7c07062bf.tar.gz
hugo-08b582e18730d44111203e28e761c5c7c07062bf.zip
Only do one livereload replacement
Diffstat (limited to 'transform')
-rw-r--r--transform/livereloadinject.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/transform/livereloadinject.go b/transform/livereloadinject.go
index 9eab45f78..bd22901df 100644
--- a/transform/livereloadinject.go
+++ b/transform/livereloadinject.go
@@ -24,12 +24,12 @@ func LiveReloadInject(ct contentTransformer) {
replaceTemplate := `<script data-no-instant>document.write('<script src="/livereload.js?mindelay=10"></' + 'script>')</script>%s`
replace := []byte(fmt.Sprintf(replaceTemplate, endBodyTag))
- newcontent := bytes.Replace(ct.Content(), match, replace, -1)
+ newcontent := bytes.Replace(ct.Content(), match, replace, 1)
if len(newcontent) == len(ct.Content()) {
endBodyTag = "</BODY>"
replace := []byte(fmt.Sprintf(replaceTemplate, endBodyTag))
match := []byte(endBodyTag)
- newcontent = bytes.Replace(ct.Content(), match, replace, -1)
+ newcontent = bytes.Replace(ct.Content(), match, replace, 1)
}
ct.Write(newcontent)