mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
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.
This commit is contained in:
parent
3c3fc45d3c
commit
b9e835b101
1 changed files with 1 additions and 1 deletions
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue