From 2bcbf104006e0ec03be4fd500f2519301d460f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 5 May 2017 09:24:37 +0200 Subject: hugolib: Prepare render per output format See #3220 --- hugolib/shortcode.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hugolib/shortcode.go') diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index b088ed61d..abe445d71 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -309,6 +309,7 @@ func executeShortcodeFuncMap(funcs map[string]func() (string, error)) (map[strin } func renderShortcodes(shortcodes map[string]shortcode, p *Page) map[string]func() (string, error) { + renderedShortcodes := make(map[string]func() (string, error)) for key, sc := range shortcodes { @@ -316,8 +317,8 @@ func renderShortcodes(shortcodes map[string]shortcode, p *Page) map[string]func( // need to have something to replace with renderedShortcodes[key] = emptyShortcodeFn } else { - shorctode := sc - renderedShortcodes[key] = func() (string, error) { return renderShortcode(shorctode, nil, p), nil } + shortcode := sc + renderedShortcodes[key] = func() (string, error) { return renderShortcode(shortcode, nil, p), nil } } } -- cgit v1.2.3