示例#1
0
文件: taller.go 项目: rif/gocmd
func mainPage(w http.ResponseWriter, r *http.Request) {
	p, _ := os.Getwd()
	os.Setenv("TALLER_PATH", p+"/taller")
	template := taller.NewTemplateFile("index.html")
	context := taller.Context{"c": os.Getenv("TALLER_PATH")}

	content := taller.Render(template, context)
	io.WriteString(w, string(content))
}
示例#2
0
文件: tlr.go 项目: rif/gocmd
func main() {
	os.Setenv("TALLER_PATH", "/home/rif/Documents/prog/go/src/cmd")
	println(string(taller.Render(taller.NewTemplateFile("template.html"), taller.Context{})))
}