package yatwiki import ( "fmt" "html/template" "net/http" "net/url" ) func (this *WikiServer) routeIndex(w http.ResponseWriter, r *http.Request) { titles, err := this.db.ListTitles() if err != nil { this.serveInternalError(w, r, err) return } totalRevs, err := this.db.TotalRevisions() if err != nil { this.serveInternalError(w, r, err) return } content := fmt.Sprintf(`

Article Index


There are %d edits to %d pages.

` pto := DefaultPageTemplateOptions(this.opts) pto.CurrentPageName = "Index" pto.Content = template.HTML(content) this.servePageResponse(w, r, pto) return }