render shortcodes prior to converting to html

This commit is contained in:
spf13
2013-12-06 23:32:00 -05:00
parent a45de56db1
commit f432b187a0
4 changed files with 33 additions and 8 deletions

View File

@@ -170,8 +170,6 @@ func (s *Site) Render() (err error) {
return
}
s.timerStep("render and write aliases")
s.ProcessShortcodes()
s.timerStep("render shortcodes")
if err = s.RenderIndexes(); err != nil {
return
}
@@ -289,6 +287,16 @@ func (s *Site) CreatePages() (err error) {
page.Tmpl = s.Tmpl
page.Section = file.Section
page.Dir = file.Dir
// Handling short codes prior to Conversion to HTML
page.Content = template.HTML(ShortcodesHandle(string(page.Content), page, s.Tmpl))
page.Summary = template.HTML(ShortcodesHandle(string(page.Summary), page, s.Tmpl))
err = page.Convert()
if err != nil {
return err
}
if s.Config.BuildDrafts || !page.Draft {
s.Pages = append(s.Pages, page)
}