Add: ability to set custom substitution map

This commit is contained in:
Dobrosław Żybort 2013-05-10 15:23:01 +02:00
parent dba1820a69
commit f8ad7d8035

View File

@ -11,6 +11,11 @@ import (
"strings"
)
var (
// Custom substitution map
CustomSub map[rune]string
)
//=============================================================================
// Make returns slug generated from provided string. Will use "en" as language
@ -37,6 +42,7 @@ func MakeLang(s string, lang string) (slug string) {
}
slug = substitute(slug, defaultSub)
slug = substitute(slug, CustomSub)
slug = unidecode.Unidecode(slug)