mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-28 20:51:00 +00:00
parent
659f71e617
commit
47c8f32967
1 changed files with 8 additions and 2 deletions
|
@ -199,14 +199,20 @@ func (p *Page) getRenderingConfig() *helpers.Blackfriday {
|
||||||
pageParam := p.GetParam("blackfriday")
|
pageParam := p.GetParam("blackfriday")
|
||||||
siteParam := viper.GetStringMap("blackfriday")
|
siteParam := viper.GetStringMap("blackfriday")
|
||||||
|
|
||||||
|
combinedParam := make(map[string]interface{})
|
||||||
|
|
||||||
|
for k, v := range siteParam {
|
||||||
|
combinedParam[k] = v
|
||||||
|
}
|
||||||
|
|
||||||
if pageParam != nil {
|
if pageParam != nil {
|
||||||
pageConfig := cast.ToStringMap(pageParam)
|
pageConfig := cast.ToStringMap(pageParam)
|
||||||
for key, value := range pageConfig {
|
for key, value := range pageConfig {
|
||||||
siteParam[key] = value
|
combinedParam[key] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.renderingConfig = new(helpers.Blackfriday)
|
p.renderingConfig = new(helpers.Blackfriday)
|
||||||
if err := mapstructure.Decode(siteParam, p.renderingConfig); err != nil {
|
if err := mapstructure.Decode(combinedParam, p.renderingConfig); err != nil {
|
||||||
jww.FATAL.Printf("Failed to get rendering config for %s:\n%s", p.BaseFileName(), err.Error())
|
jww.FATAL.Printf("Failed to get rendering config for %s:\n%s", p.BaseFileName(), err.Error())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue