mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-20 02:11:54 +00:00
parent
bea9280fb3
commit
bec2c1e37a
1 changed files with 16 additions and 3 deletions
|
@ -82,9 +82,22 @@ type htmlHandler struct {
|
||||||
|
|
||||||
func (h htmlHandler) Extensions() []string { return []string{"html", "htm"} }
|
func (h htmlHandler) Extensions() []string { return []string{"html", "htm"} }
|
||||||
func (h htmlHandler) PageConvert(p *Page, t tpl.Template) HandledResult {
|
func (h htmlHandler) PageConvert(p *Page, t tpl.Template) HandledResult {
|
||||||
// see #674 - disabled by bjornerik for now
|
p.ProcessShortcodes(t)
|
||||||
// p.ProcessShortcodes(t)
|
var content []byte
|
||||||
p.Content = helpers.BytesToHTML(p.rawContent)
|
var err error
|
||||||
|
|
||||||
|
if len(p.contentShortCodes) > 0 {
|
||||||
|
content, err = replaceShortcodeTokens(p.rawContent, shortcodePlaceholderPrefix, true, p.contentShortCodes)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
jww.FATAL.Printf("Fail to replace shortcode tokens in %s:\n%s", p.BaseFileName(), err.Error())
|
||||||
|
return HandledResult{err: err}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
content = p.rawContent
|
||||||
|
}
|
||||||
|
|
||||||
|
p.Content = helpers.BytesToHTML(content)
|
||||||
return HandledResult{err: nil}
|
return HandledResult{err: nil}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue