mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05: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")
|
||||
siteParam := viper.GetStringMap("blackfriday")
|
||||
|
||||
combinedParam := make(map[string]interface{})
|
||||
|
||||
for k, v := range siteParam {
|
||||
combinedParam[k] = v
|
||||
}
|
||||
|
||||
if pageParam != nil {
|
||||
pageConfig := cast.ToStringMap(pageParam)
|
||||
for key, value := range pageConfig {
|
||||
siteParam[key] = value
|
||||
combinedParam[key] = value
|
||||
}
|
||||
}
|
||||
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())
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue