mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
Make removal of accents in taxonomy and section paths optional
And default off. Fixes #1180
This commit is contained in:
@@ -99,9 +99,16 @@ func UnicodeSanitize(s string) string {
|
||||
}
|
||||
}
|
||||
|
||||
// remove accents - see https://blog.golang.org/normalization
|
||||
t := transform.Chain(norm.NFD, transform.RemoveFunc(isMn), norm.NFC)
|
||||
result, _, _ := transform.String(t, string(target))
|
||||
var result string
|
||||
|
||||
if viper.GetBool("RemovePathAccents") {
|
||||
// remove accents - see https://blog.golang.org/normalization
|
||||
t := transform.Chain(norm.NFD, transform.RemoveFunc(isMn), norm.NFC)
|
||||
result, _, _ = transform.String(t, string(target))
|
||||
} else {
|
||||
result = string(target)
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
return string(target)
|
||||
|
Reference in New Issue
Block a user