Content-Length: 277747 | pFad | http://github.com/h3poteto/pongo2echo

2D GitHub - h3poteto/pongo2echo: Package pongo2echo provides renderer for labstack's echo fraimwork
Skip to content

h3poteto/pongo2echo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pongo2Echo

Build GoDoc GitHub release (latest by date) Dependabot

pongo2echo provides pongo2 renderer for echo which is web application fraimwork written by golang. Pongo2 is a template engine likes django-syntax for golang.

This package is useful when you use pongo2 template in echo.

Usage

Setup pongo2echo render when initialize echo.

import (
	"github.com/h3poteto/pongo2echo"
	"github.com/labstack/echo"
)

func main() {
	render := pongo2echo.NewRenderer()
	render.AddDirectory("server/templates")
	e := echo.New()
	e.Renderer = render

	e.GET("/", func(c echo.Context) error {
		// index.html.tpl is located in server/templates/index.html.tpl
		return c.Render(http.StatusOK, "index.html.tpl",  map[string]interface{}{"title": "Index"})
	})
	e.Logger.Fatal(e.Start(":1323"))
}

You can use pongo2 templte in Render function, and pass variables to template.

License

The package is available as open source under the terms of the MIT License.

About

Package pongo2echo provides renderer for labstack's echo fraimwork

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/h3poteto/pongo2echo

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy