~erock/pico

648d68236a3cea91130bd1a6914a367c1edac1fb — Eric Bower a month ago fb68af2
fix(lists): rss feeds did not handle nested lists
2 files changed, 4 insertions(+), 5 deletions(-)

M lists/api.go
M shared/api.go
M lists/api.go => lists/api.go +2 -2
@@ 480,7 480,7 @@ func rssBlogHandler(w http.ResponseWriter, r *http.Request) {
		return
	}

	ts, err := template.ParseFiles(
	ts, err := template.New("base").Funcs(shared.FuncMap).ParseFiles(
		cfg.StaticPath("html/rss.page.tmpl"),
		cfg.StaticPath("html/list.partial.tmpl"),
	)


@@ 574,7 574,7 @@ func rssHandler(w http.ResponseWriter, r *http.Request) {
		return
	}

	ts, err := template.ParseFiles(
	ts, err := template.New("base").Funcs(shared.FuncMap).ParseFiles(
		cfg.StaticPath("html/rss.page.tmpl"),
		cfg.StaticPath("html/list.partial.tmpl"),
	)

M shared/api.go => shared/api.go +2 -3
@@ 74,7 74,7 @@ func intRange(start, end int) []int {
	return result
}

var funcMap = template.FuncMap{
var FuncMap = template.FuncMap{
	"minus":    minus,
	"intRange": intRange,
}


@@ 89,8 89,7 @@ func RenderTemplate(cfg *ConfigSite, templates []string) (*template.Template, er
		cfg.StaticPath("html/base.layout.tmpl"),
	)

	ts, err := template.New("base").Funcs(funcMap).ParseFiles(files...)
	// ts, err := template.ParseFiles(files...)
	ts, err := template.New("base").Funcs(FuncMap).ParseFiles(files...)
	if err != nil {
		return nil, err
	}