Skip to content

Instantly share code, notes, and snippets.

@takuan-osho
Created January 20, 2014 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuan-osho/8518873 to your computer and use it in GitHub Desktop.
Save takuan-osho/8518873 to your computer and use it in GitHub Desktop.
package main
import (
"github.com/codegangsta/martini"
"github.com/codegangsta/martini-contrib/render"
)
func main() {
m := martini.Classic()
// render html template from templates directory
m.Use(render.Renderer(render.Options{
Directory: "templates",
Layout: "layout",
Extensions: []string{".tmpl", ".html"},
Charset: "UTF-8",
}))
m.Get("/", hello)
m.Run()
}
func hello(r render.Render) {
r.HTML(200, "hello", "master")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment