~srivathsan/blaze

7c2c724771bcc48f7217770eed5d0842442626a2 — Srivathsan Murali 3 years ago b13c50f
templates: close summary with </p>
1 files changed, 3 insertions(+), 2 deletions(-)

M builder/templates.go
M builder/templates.go => builder/templates.go +3 -2
@@ 2,6 2,7 @@ package builder

import (
	"bytes"
	"fmt"
	"html"
	"log"
	"path"


@@ 54,8 55,8 @@ func getTemplateFuncs(config *config.BlazeConfig) template.FuncMap {
			return html.EscapeString(content)
		},
		"summary": func(content string) string {
			words := strings.Split(content, "</p>")
			return words[0]
			index := strings.Index(content, "</p>")
			return fmt.Sprintf("%s</p>", content[:index])
		},
	}
}