File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -606,15 +606,20 @@ func (p *Page) renderContent(content []byte) []byte {
606606}
607607
608608func (p * Page ) getRenderingConfig () * helpers.Blackfriday {
609-
610609 p .renderingConfigInit .Do (func () {
611- pageParam := cast .ToStringMap (p .GetParam ("blackfriday" ))
610+ p .renderingConfig = p .s .ContentSpec .NewBlackfriday ()
611+
612612 if p .Language () == nil {
613613 panic (fmt .Sprintf ("nil language for %s with source lang %s" , p .BaseFileName (), p .lang ))
614614 }
615- p .renderingConfig = p .s .ContentSpec .NewBlackfriday ()
616615
617- if err := mapstructure .Decode (pageParam , p .renderingConfig ); err != nil {
616+ bfParam := p .GetParam ("blackfriday" )
617+ if bfParam == nil {
618+ return
619+ }
620+
621+ pageParam := cast .ToStringMap (bfParam )
622+ if err := mapstructure .Decode (pageParam , & p .renderingConfig ); err != nil {
618623 p .s .Log .FATAL .Printf ("Failed to get rendering config for %s:\n %s" , p .BaseFileName (), err .Error ())
619624 }
620625
You can’t perform that action at this time.
0 commit comments