mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
parent
bef3df7481
commit
bea9280fb3
3 changed files with 30 additions and 6 deletions
|
@ -77,7 +77,7 @@ func sanitizeURLWithFlags(in string, f purell.NormalizationFlags) string {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if !strings.HasPrefix(u.Path, "/") {
|
||||
if len(u.Path) > 0 && !strings.HasPrefix(u.Path, "/") {
|
||||
u.Path = "/" + u.Path
|
||||
}
|
||||
return u.String()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue