hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 783f0d615486314f84d1c25941e5975bb2afdf73
parent 6789b6c5ce03f055e3e401a3c181fea722e2ccd0
Author: spf13 <steve.francia@gmail.com>
Date:   Tue,  6 Aug 2013 01:06:59 +0200

fixing badlink on homepage

Diffstat:
Mdocs/config.yaml | 4++--
Mhugolib/site.go | 10++++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/docs/config.yaml b/docs/config.yaml
@@ -1,4 +1,4 @@
-Indexes:
+indexes:
   tag: 'tags'
-BaseUrl: 'http://localhost'
+baseurl: 'http://hugo.spf13.com'
 ...
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -200,10 +200,12 @@ func (s *Site) ProcessShortcodes() {
 func (s *Site) AbsUrlify() {
 	for i, _ := range s.Pages {
 		content := string(s.Pages[i].Content)
-		content = strings.Replace(content, " src=\"/", " src=\""+s.c.BaseUrl+"/", -1)
-		content = strings.Replace(content, " src='/", " src='"+s.c.BaseUrl+"/", -1)
-		content = strings.Replace(content, " href='/", " href='"+s.c.BaseUrl+"/", -1)
-		content = strings.Replace(content, " href=\"/", " href=\""+s.c.BaseUrl+"/", -1)
+		content = strings.Replace(content, " src=\"/", " src=\""+s.c.BaseUrl, -1)
+		content = strings.Replace(content, " src='/", " src='"+s.c.BaseUrl, -1)
+		content = strings.Replace(content, " href='/", " href='"+s.c.BaseUrl, -1)
+		content = strings.Replace(content, " href=\"/", " href=\""+s.c.BaseUrl, -1)
+		baseWithoutTrailingSlash := strings.TrimRight(s.c.BaseUrl, "/")
+		content = strings.Replace(content, baseWithoutTrailingSlash+"//", baseWithoutTrailingSlash+"/", -1)
 		s.Pages[i].Content = template.HTML(content)
 	}
 }