mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Simplifying the siteInfo handling
This commit is contained in:
parent
280df4e380
commit
4076d77029
1 changed files with 1 additions and 12 deletions
|
@ -260,18 +260,7 @@ func (s *Site) initialize() (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Site) initializeSiteInfo() {
|
func (s *Site) initializeSiteInfo() {
|
||||||
paramsV, ok := viper.Get("Params").(map[interface{}]interface{})
|
params := viper.GetStringMap("Params")
|
||||||
// Warning: viper.Get(map_item) returns map[interface{}]interface{}
|
|
||||||
// even if .SetDefault called with a map[string]interface{}
|
|
||||||
if !ok {
|
|
||||||
paramsV = make(map[interface{}]interface{})
|
|
||||||
}
|
|
||||||
params := make(map[string]interface{}, len(paramsV))
|
|
||||||
for k, v := range paramsV {
|
|
||||||
if s, ok := k.(string); ok {
|
|
||||||
params[s] = v
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
permalinks := make(PermalinkOverrides)
|
permalinks := make(PermalinkOverrides)
|
||||||
for k, v := range viper.GetStringMapString("Permalinks") {
|
for k, v := range viper.GetStringMapString("Permalinks") {
|
||||||
|
|
Loading…
Reference in a new issue