Example #1
0
func init() {
	web.Funcs["split"] = func(s, sep string, i int) string {
		return strings.Split(s, sep)[i]
	}
	web.Funcs["title"] = strings.Title
	tmpl = web.NewTmplCache()
	db.AddStore("image")
	db.AddStore("listing")
}
func init() {
	db = adb.NewDB()
	// db2 = repono.Embed(repono.EmbedAndServeDB(":9999"))
	web.Funcs["split"] = func(s, sep string, i int) string {
		return strings.Split(s, sep)[i]
	}
	web.Funcs["json"] = func(v interface{}) string {
		b, err := json.Marshal(v)
		if err != nil {
			return ""
		}
		return string(b)
	}
	tmpl = web.NewTmplCache()
}