From: spf13 Date: Fri, 26 Jul 2013 13:27:22 +0000 (-0400) Subject: fixing issue with some urls missing '/' X-Git-Tag: v0.8~16 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e08d14ad;p=brevno-suite%2Fhugo fixing issue with some urls missing '/' --- diff --git a/hugolib/site.go b/hugolib/site.go index 18b007e4..85ddd655 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -190,10 +190,10 @@ 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) s.Pages[i].Content = template.HTML(content) } }