Ejemplo n.º 1
0
func (c *PageController) Feed(r *gadget.Request) (int, interface{}) {
	feed := NewFeed(c.pages)
	feed.Title = "farmr.org"
	feed.Subtitle = "data-driven microfarming"
	response := gadget.NewResponse(feed)
	response.Headers.Set("Content-Type", "application/atom+xml")
	return 200, response
}
Ejemplo n.º 2
0
func (c *SitemapController) Show(r *gadget.Request) (int, interface{}) {
	if urlset, found := urlSets[r.UrlParams["sitemap_id"]]; !found {
		return 404, ""
	} else {
		response := gadget.NewResponse(urlset)
		response.Headers.Set("Content-Type", "text/xml")
		return 200, response
	}
}
Ejemplo n.º 3
0
func (c *SitemapController) Index(r *gadget.Request) (int, interface{}) {
	index := NewSitemapIndex()
	response := gadget.NewResponse(index)
	response.Headers.Set("Content-Type", "text/xml")
	return 200, response
}