Esempio n. 1
0
File: news.go Progetto: fd/simplex
func generate_article_pages(articles *static.C) {
	shttp.Render(articles, func(article *Article, w shttp.Writer) error {
		w.Path(fmt.Sprintf("/articles/%d", article.Id))

		return article_tmpl.Execute(w, article)
	})
}
Esempio n. 2
0
File: news.go Progetto: fd/simplex
func generate_index_pages(articles *static.C) {
	index_pages := paginate.Paginate(articles, 50)

	shttp.Render(index_pages, func(page *paginate.Page, w shttp.Writer) error {
		if page.Number == 1 {
			w.Path("/articles")
		}

		w.Path(fmt.Sprintf("/articles/page-%d", page.Number))

		return index_tmpl.Execute(w, page)
	})
}