func IndexListHandler(blog_config map[string]interface{}, url_stem string) func(w http.ResponseWriter, req *http.Request) { limit, err := getLimit(blog_config) if err != nil { panic(err) } l := func(w http.ResponseWriter, req *http.Request) { list(w, req, blog_config, url_stem, 0, limit, post.GetPostsMatchingTagCurried("visible")) } return std_layout(blog_config, l) }
func IndexPageHandler(blog_config map[string]interface{}, url_stem string) func(w http.ResponseWriter, req *http.Request) { l := func(w http.ResponseWriter, req *http.Request) { limit, err := getLimit(blog_config) if err != nil { panic(err) } offset, err := getOffset(req, limit, ":page") if err != nil { http.Error(w, "bad request: "+err.Error(), http.StatusBadRequest) return } else { list(w, req, blog_config, url_stem, offset, limit, post.GetPostsMatchingTagCurried("visible")) } } return std_layout(blog_config, l) }
func LabelList(blog_config map[string]interface{}, url_stem string) func(w http.ResponseWriter, req *http.Request) { limit, err := getLimit(blog_config) if err != nil { panic(err) } l := func(w http.ResponseWriter, req *http.Request) { label := req.URL.Query().Get(":label") context := map[string]interface{}{"search_label": label} total_con := config.Merge(blog_config, context) q := func(w http.ResponseWriter, req *http.Request) { list(w, req, total_con, url_stem, 0, limit, post.GetPostsMatchingTagCurried(label)) } std_layout(total_con, q)(w, req) } return l }
func LabelPage(blog_config map[string]interface{}, url_stem string) func(w http.ResponseWriter, req *http.Request) { l := func(w http.ResponseWriter, req *http.Request) { label := req.URL.Query().Get(":label") context := map[string]interface{}{"search_label": label} total_con := config.Merge(blog_config, context) q := func(w http.ResponseWriter, req *http.Request) { limit, err := getLimit(blog_config) if err != nil { panic(err) } offset, err := getOffset(req, limit, ":page") if err != nil { http.Error(w, "bad request: "+err.Error(), http.StatusBadRequest) return } else { list(w, req, total_con, url_stem, offset, limit, post.GetPostsMatchingTagCurried(label)) } } std_layout(total_con, q)(w, req) } return l }