mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-20 01:51:51 +00:00
Merge pull request #44 from cactus/avoid-redirect-with-slugs
avoid possible redirects with non-ugly slug urls
This commit is contained in:
commit
c4bcdebc59
1 changed files with 1 additions and 1 deletions
|
@ -192,7 +192,7 @@ func (p *Page) Permalink() template.HTML {
|
||||||
if p.Site.Config.UglyUrls {
|
if p.Site.Config.UglyUrls {
|
||||||
return template.HTML(MakePermalink(string(p.Site.BaseUrl), strings.TrimSpace(p.Section)+"/"+p.Slug+"."+p.Extension))
|
return template.HTML(MakePermalink(string(p.Site.BaseUrl), strings.TrimSpace(p.Section)+"/"+p.Slug+"."+p.Extension))
|
||||||
} else {
|
} 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 {
|
} else if len(strings.TrimSpace(p.Url)) > 2 {
|
||||||
return template.HTML(MakePermalink(string(p.Site.BaseUrl), strings.TrimSpace(p.Url)))
|
return template.HTML(MakePermalink(string(p.Site.BaseUrl), strings.TrimSpace(p.Url)))
|
||||||
|
|
Loading…
Reference in a new issue