Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (21 sloc) 698 Bytes
package main
import ""
func main() {
app := iris.New()
tmpl := iris.Pug("./templates", ".pug")
tmpl.Reload(true) // reload templates on each request (development mode)
tmpl.AddFunc("greet", func(s string) string { // add your template func here.
return "Greetings " + s + "!"
app.Get("/", index)
// http://localhost:8080
func index(ctx iris.Context) {
ctx.ViewData("pageTitle", "My Index Page")
ctx.ViewData("youAreUsingJade", true)
// Q: why need extension .pug?
// A: Because you can register more than one view engine per Iris application.
You can’t perform that action at this time.