Example #1
0
// 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)
}
Example #2
0
// 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)
}