summaryrefslogtreecommitdiffhomepage
path: root/transform
diff options
context:
space:
mode:
authorAnthony Fok <[email protected]>2015-03-17 22:16:54 -0700
committerbep <[email protected]>2015-03-18 11:30:37 +0100
commit8b8fb417ae065954a056ea018bd092748cc9127c (patch)
treea9160d1f6acc218bcb8728d729deaf1b532b56b3 /transform
parentca69cad8aa5d8eefbce13abd97b2b979339a458c (diff)
downloadhugo-8b8fb417ae065954a056ea018bd092748cc9127c.tar.gz
hugo-8b8fb417ae065954a056ea018bd092748cc9127c.zip
More initialism corrections (golint)
Thanks to @bep's new, brilliant helpers.Deprecated() function, the following functions or variables are transitioned to their new names, preserving backward compatibility for v0.14 and warning the user of upcoming obsolescence in v0.15: * .Url → .URL (for node, menu and paginator) * .Site.BaseUrl → .Site.BaseURL * .Site.Indexes → .Site.Taxonomies * .Site.Recent → .Site.Pages * getJson → getJSON * getCsv → getCSV * safeHtml → safeHTML * safeCss → safeCSS * safeUrl → safeURL Also fix related initialisms in strings and comments. Continued effort in fixing #959.
Diffstat (limited to 'transform')
-rw-r--r--transform/absurl.go10
-rw-r--r--transform/absurlreplacer.go4
2 files changed, 7 insertions, 7 deletions
diff --git a/transform/absurl.go b/transform/absurl.go
index 12f616eea..6fc62adcf 100644
--- a/transform/absurl.go
+++ b/transform/absurl.go
@@ -7,15 +7,15 @@ import (
var absURLInit sync.Once
var ar *absURLReplacer
-// for performance reasons, we reuse the first baseUrl given
-func initAbsurlReplacer(baseURL string) {
+// for performance reasons, we reuse the first baseURL given
+func initAbsURLReplacer(baseURL string) {
absURLInit.Do(func() {
- ar = newAbsurlReplacer(baseURL)
+ ar = newAbsURLReplacer(baseURL)
})
}
func AbsURL(absURL string) (trs []link, err error) {
- initAbsurlReplacer(absURL)
+ initAbsURLReplacer(absURL)
trs = append(trs, func(content []byte) []byte {
return ar.replaceInHTML(content)
@@ -24,7 +24,7 @@ func AbsURL(absURL string) (trs []link, err error) {
}
func AbsURLInXML(absURL string) (trs []link, err error) {
- initAbsurlReplacer(absURL)
+ initAbsURLReplacer(absURL)
trs = append(trs, func(content []byte) []byte {
return ar.replaceInXML(content)
diff --git a/transform/absurlreplacer.go b/transform/absurlreplacer.go
index a3c68eac9..2f2a5bd53 100644
--- a/transform/absurlreplacer.go
+++ b/transform/absurlreplacer.go
@@ -120,7 +120,7 @@ func checkCandidate(l *contentlexer) {
}
if bytes.HasPrefix(l.content[l.pos:], m.match) {
- // check for schemaless urls
+ // check for schemaless URLs
posAfter := l.pos + len(m.match)
if int(posAfter) >= len(l.content) {
return
@@ -196,7 +196,7 @@ type absURLReplacer struct {
xmlMatchers []absURLMatcher
}
-func newAbsurlReplacer(baseURL string) *absURLReplacer {
+func newAbsURLReplacer(baseURL string) *absURLReplacer {
u, _ := url.Parse(baseURL)
base := strings.TrimRight(u.String(), "/")