mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-12 13:47:09 +03:00
Add a way to disable one or more languages
This commit adds a new config setting: ```toml disableLanguages = ["fr"] ``` If this is a multilingual site: * No site for the French language will be created * French content pages will be ignored/not read * The French language configuration (menus etc.) will also be ignored This makes it possible to start translating new languages and turn it on when you're happy etc. Fixes #4297 Fixed #4329
This commit is contained in:
parent
322c567220
commit
6413559f75
10 changed files with 160 additions and 42 deletions
|
@ -140,6 +140,11 @@ func (l *Language) GetStringMapString(key string) map[string]string {
|
|||
return cast.ToStringMapString(l.Get(key))
|
||||
}
|
||||
|
||||
// returns the value associated with the key as a slice of strings.
|
||||
func (l *Language) GetStringSlice(key string) []string {
|
||||
return cast.ToStringSlice(l.Get(key))
|
||||
}
|
||||
|
||||
// Get returns a value associated with the key relying on specified language.
|
||||
// Get is case-insensitive for a key.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue