mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
render shortcodes prior to converting to html
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user