diff options
author | elij <elij@wundrd.net> | 2013-08-16 13:14:20 -0700 |
---|---|---|
committer | elij <elij@wundrd.net> | 2013-08-16 13:14:20 -0700 |
commit | b9e835b1012350d5b043568b126a90a316ca50cd (patch) | |
tree | c47f9f459f4e7240cc3c30dd3cc94491fdf0c351 | |
parent | 3c3fc45d3c34a7dcd1a0e9fd2636e7a5c5933e03 (diff) |
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.
-rw-r--r-- | hugolib/page.go | 2 |
1 files changed, 1 insertions, 1 deletions
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))) |