You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
owl-blogs/renderer.go

12 lines
288 B

package kiss
import "strings"
func RenderPost(post Post) (string, error) {
template, _ := post.user.Template()
buf, _ := post.MarkdownData()
postHtml := "<h1>" + post.Title() + "</h1>\n"
postHtml += buf.String()
return strings.Replace(template, "{{content}}", postHtml, -1), nil
}