From: spf13 Date: Fri, 5 Jul 2013 16:03:47 +0000 (-0400) Subject: rendering shortcodes earlier for better performance X-Git-Tag: v0.8~46 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f8755771;p=brevno-suite%2Fhugo rendering shortcodes earlier for better performance --- diff --git a/hugolib/site.go b/hugolib/site.go index 210bde7e..2d4fd064 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -81,10 +81,10 @@ func (site *Site) Render() { site.timer.Step("render and write indexes") site.RenderLists() site.timer.Step("render and write lists") - site.RenderPages() - site.timer.Step("render pages") site.ProcessShortcodes() site.timer.Step("render shortcodes") + site.RenderPages() + site.timer.Step("render pages") site.RenderHomePage() site.timer.Step("render and write homepage") } @@ -178,9 +178,7 @@ func (s *Site) checkDirectories() { func (s *Site) ProcessShortcodes() { for i, _ := range s.Pages { - var bb bytes.Buffer - bb.WriteString(ShortcodesHandle(s.Pages[i].RenderedContent.String(), s.Pages[i], s.Tmpl)) - s.Pages[i].RenderedContent = &bb + s.Pages[i].Content = template.HTML(ShortcodesHandle(string(s.Pages[i].Content), s.Pages[i], s.Tmpl)) } }