shithub: hugo

Download patch

ref: e7099cfa26d31cc7544e6db37899678ef8bd65ff
parent: 98ee69bce207a4c2a7c2ffca2b3e7c0ccdd6e8c9
author: bep <[email protected]>
date: Wed Mar 18 13:33:12 EDT 2015

Un-export ContentReWriter

--- a/transform/absurl.go
+++ b/transform/absurl.go
@@ -17,7 +17,7 @@
 func AbsURL(absURL string) (trs []link, err error) {
 	initAbsURLReplacer(absURL)
 
-	trs = append(trs, func(rw ContentReWriter) {
+	trs = append(trs, func(rw contentRewriter) {
 		ar.replaceInHTML(rw)
 	})
 	return
@@ -26,7 +26,7 @@
 func AbsURLInXML(absURL string) (trs []link, err error) {
 	initAbsURLReplacer(absURL)
 
-	trs = append(trs, func(rw ContentReWriter) {
+	trs = append(trs, func(rw contentRewriter) {
 		ar.replaceInXML(rw)
 	})
 	return
--- a/transform/absurlreplacer.go
+++ b/transform/absurlreplacer.go
@@ -176,7 +176,7 @@
 	}
 }
 
-func doReplace(rw ContentReWriter, matchers []absURLMatcher) {
+func doReplace(rw contentRewriter, matchers []absURLMatcher) {
 
 	lexer := &contentlexer{
 		content:      rw.Content(),
@@ -226,10 +226,10 @@
 
 }
 
-func (au *absURLReplacer) replaceInHTML(rw ContentReWriter) {
+func (au *absURLReplacer) replaceInHTML(rw contentRewriter) {
 	doReplace(rw, au.htmlMatchers)
 }
 
-func (au *absURLReplacer) replaceInXML(rw ContentReWriter) {
+func (au *absURLReplacer) replaceInXML(rw contentRewriter) {
 	doReplace(rw, au.xmlMatchers)
 }
--- a/transform/chain.go
+++ b/transform/chain.go
@@ -6,7 +6,7 @@
 	"io"
 )
 
-type trans func(rw ContentReWriter)
+type trans func(rw contentRewriter)
 
 type link trans
 
@@ -20,14 +20,14 @@
 	return make([]link, 0, 20)
 }
 
-// ContentReWriter is an interface that enables rotation
+// contentRewriter is an interface that enables rotation
 // of pooled buffers in the transformer chain.
-type ContentReWriter interface {
+type contentRewriter interface {
 	Content() []byte
 	io.Writer
 }
 
-// Implements ContentReWriter
+// Implements contentRewriter
 // Content is read from the from-buffer,
 // and rewritten to to the to-buffer.
 type fromToBuffer struct {
--- a/transform/chain_test.go
+++ b/transform/chain_test.go
@@ -56,17 +56,17 @@
 }
 
 func TestChaingMultipleTransformers(t *testing.T) {
-	f1 := func(rw ContentReWriter) {
+	f1 := func(rw contentRewriter) {
 		rw.Write(bytes.Replace(rw.Content(), []byte("f1"), []byte("f1r"), -1))
 	}
-	f2 := func(rw ContentReWriter) {
+	f2 := func(rw contentRewriter) {
 		rw.Write(bytes.Replace(rw.Content(), []byte("f2"), []byte("f2r"), -1))
 	}
-	f3 := func(rw ContentReWriter) {
+	f3 := func(rw contentRewriter) {
 		rw.Write(bytes.Replace(rw.Content(), []byte("f3"), []byte("f3r"), -1))
 	}
 
-	f4 := func(rw ContentReWriter) {
+	f4 := func(rw contentRewriter) {
 		rw.Write(bytes.Replace(rw.Content(), []byte("f4"), []byte("f4r"), -1))
 	}
 
--- a/transform/livereloadinject.go
+++ b/transform/livereloadinject.go
@@ -5,7 +5,7 @@
 	"github.com/spf13/viper"
 )
 
-func LiveReloadInject(rw ContentReWriter) {
+func LiveReloadInject(rw contentRewriter) {
 	match := []byte("</body>")
 	port := viper.GetString("port")
 	replace := []byte(`<script>document.write('<script src="http://'