shithub: hugo

Download patch

ref: c4bcdebc595cc3d6c6abcddb6e0870057345daae
parent: e2744d403c8b81c4d33f6bc54f0905ddb793590a
parent: b9e835b1012350d5b043568b126a90a316ca50cd
author: Steve Francia <[email protected]>
date: Sat Aug 17 17:04:51 EDT 2013

Merge pull request #44 from cactus/avoid-redirect-with-slugs

avoid possible redirects with non-ugly slug urls

--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -192,7 +192,7 @@
 		if p.Site.Config.UglyUrls {
 			return template.HTML(MakePermalink(string(p.Site.BaseUrl), strings.TrimSpace(p.Section)+"/"+p.Slug+"."+p.Extension))
 		} else {
-			return template.HTML(MakePermalink(string(p.Site.BaseUrl), strings.TrimSpace(p.Section)+"/"+p.Slug))
+			return template.HTML(MakePermalink(string(p.Site.BaseUrl), strings.TrimSpace(p.Section)+"/"+p.Slug+"/"))
 		}
 	} else if len(strings.TrimSpace(p.Url)) > 2 {
 		return template.HTML(MakePermalink(string(p.Site.BaseUrl), strings.TrimSpace(p.Url)))