// post's preview html, // use "<!--more-->" to separate, return first part func (p *Post) PreviewHTML() template.HTML { bytes := bytes.Split(p.Raw, []byte("<!--more-->"))[0] if p.rawType == "markdown" { return template.HTML(helper.Markdown(bytes)) } return template.HTML(bytes) }
// page's html content func (p *Page) ContentHTML() template.HTML { if p.rawType == "markdown" { return template.HTML(helper.Markdown(p.Raw)) } return template.HTML(p.Raw) }