mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
@@ -14,6 +14,8 @@
|
||||
package langs
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gohugoio/hugo/common/maps"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
)
|
||||
@@ -46,5 +48,8 @@ func DecodeConfig(m map[string]any) (map[string]LanguageConfig, error) {
|
||||
if err := mapstructure.WeakDecode(m, &langs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(langs) == 0 {
|
||||
return nil, errors.New("no languages configured")
|
||||
}
|
||||
return langs, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user