package server import ( "html/template" "net/http" ) type Ui struct { pages map[string]*template.Template } func buildPages(paths ...string) Ui { // walk template files with template.ParseFS (?) return Ui{} } func (ui *Ui) RenderPage(page string, w http.ResponseWriter) { p := ui.pages[page] p.ExecuteTemplate(w, "base", nil) }