mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Optimize for the common case in Blackfriday config
This commit is contained in:
parent
c50780930e
commit
b984ec96bc
1 changed files with 8 additions and 5 deletions
|
@ -199,14 +199,17 @@ 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{})
|
combinedParam := siteParam
|
||||||
|
|
||||||
for k, v := range siteParam {
|
|
||||||
combinedParam[k] = v
|
|
||||||
}
|
|
||||||
|
|
||||||
if pageParam != nil {
|
if pageParam != nil {
|
||||||
|
combinedParam = make(map[string]interface{})
|
||||||
|
|
||||||
|
for k, v := range siteParam {
|
||||||
|
combinedParam[k] = v
|
||||||
|
}
|
||||||
|
|
||||||
pageConfig := cast.ToStringMap(pageParam)
|
pageConfig := cast.ToStringMap(pageParam)
|
||||||
|
|
||||||
for key, value := range pageConfig {
|
for key, value := range pageConfig {
|
||||||
combinedParam[key] = value
|
combinedParam[key] = value
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue