From b9e835b1012350d5b043568b126a90a316ca50cd Mon Sep 17 00:00:00 2001 From: elij Date: Fri, 16 Aug 2013 13:14:20 -0700 Subject: [PATCH] avoid handling a redirect from slug to slug/ because the url lacks a trailing /, many webservers will issue a redirect to the canonical url with trailing slash for directory index w/index.htm(l). Append a slash to avoid this. --- hugolib/page.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugolib/page.go b/hugolib/page.go index aca0bc203..c3aebb3f2 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -192,7 +192,7 @@ func (p *Page) Permalink() template.HTML { 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)))