mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
Add config option "disablePathToLower"
Enabling this prevents lowercasing of the path/url. Fixes #557
This commit is contained in:
parent
49fe04c0bd
commit
52d94fa675
7 changed files with 45 additions and 11 deletions
|
@ -78,11 +78,13 @@ func MakePath(s string) string {
|
|||
return UnicodeSanitize(strings.Replace(strings.TrimSpace(s), " ", "-", -1))
|
||||
}
|
||||
|
||||
// MakePathToLower creates a Unicode-sanitized string, with the spaces replaced,
|
||||
// and transformed to lower case.
|
||||
// E.g. Social Media -> social-media
|
||||
func MakePathToLower(s string) string {
|
||||
return strings.ToLower(MakePath(s))
|
||||
// MakePathSanitized creates a Unicode-sanitized string, with the spaces replaced
|
||||
func MakePathSanitized(s string) string {
|
||||
if viper.GetBool("DisablePathToLower") {
|
||||
return MakePath(s)
|
||||
} else {
|
||||
return strings.ToLower(MakePath(s))
|
||||
}
|
||||
}
|
||||
|
||||
func MakeTitle(inpath string) string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue