Pongo2 template engine middleware for tango
Go to file
Lunny Xiao 2c1afd877c
All checks were successful
checks / check and test (push) Successful in 33s
Fix go mod
2023-04-20 15:35:22 +08:00
.gitea/workflows Use actions instead of drone 2023-04-20 15:24:41 +08:00
templates init 2014-12-25 13:03:30 +08:00
go.mod Fix go mod 2023-04-20 15:35:22 +08:00
go.sum Fix go mod 2023-04-20 15:35:22 +08:00
README.md use go mod and moved to gitea.com 2019-10-31 23:11:20 +08:00
tpongo2_test.go Fix go mod 2023-04-20 15:35:22 +08:00
tpongo2.go Fix go mod 2023-04-20 15:35:22 +08:00

tpongo2 Build Status

Middleware tpongo2 is a pongo2.v3 template engine support for Tango.

Installation

go get gitea.com/tango/tpongo2

Simple Example

package main

import (
    "gitea.com/lunny/tango"
    "gitea.com/tango/tpongo2"
    "github.com/flosch/pongo2"
)

type RenderAction struct {
    tpongo2.Renderer
}

func (a *RenderAction) Get() error {
    return a.RenderString("Hello {{ name }}!", pongo2.Context{
        "name": "tango",
    })
}

func main() {
    o := tango.Classic()
    o.Use(tpongo2.New())
    o.Get("/", new(RenderAction))
}

Getting Help