aboutsummaryrefslogtreecommitdiff
path: root/src/server/ui.go
blob: f0b73ad2b07fe2b9f694d7a77c1951fdca8909c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
}