View definition

package pongo2

Defined in


A Django-syntax like template-engine

Blog posts about pongo2 (including introduction and migration):

Complete documentation on the template language:

Try out pongo2 live in the pongo2 playground:

Make sure to read in the repository as well.

A tiny example with template strings:

(Snippet on playground:

// Compile the template first (i. e. creating the AST)
tpl, err := pongo2.FromString("Hello {{ name|capfirst }}!")
if err != nil {
// Now you can render the template with the given
// pongo2.Context how often you want to.
out, err := tpl.Execute(pongo2.Context{"name": "fred"})
if err != nil {
fmt.Println(out) // Output: Hello Fred!

pongo2 is referenced in 50 repositories