~srivathsan/blaze

b13c50fa4abc7790968423d5a6d2216203de2275 — Srivathsan Murali 3 years ago f162598
add summary template function
1 files changed, 5 insertions(+), 0 deletions(-)

M builder/templates.go
M builder/templates.go => builder/templates.go +5 -0
@@ 7,6 7,7 @@ import (
	"path"
	"path/filepath"
	"sort"
	"strings"
	"text/template"
	"time"



@@ 52,6 53,10 @@ func getTemplateFuncs(config *config.BlazeConfig) template.FuncMap {
		"escapeHTML": func(content string) string {
			return html.EscapeString(content)
		},
		"summary": func(content string) string {
			words := strings.Split(content, "</p>")
			return words[0]
		},
	}
}