Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 988 Bytes

README.md

File metadata and controls

42 lines (31 loc) · 988 Bytes

Pongo2Buffalo

Build Status

An adapter to use Pongo2 with Buffalo.

Usage

Configure the adapter to replace Plush for html files, in the render.go file:

package actions

import (
	"github.com/gobuffalo/buffalo/render"
	"github.com/gobuffalo/packr"
	"github.com/stanislas-m/pongo2buffalo"
)

var r *render.Engine
var assetsBox = packr.NewBox("../public/assets")

func init() {
	r = render.New(render.Options{
		TemplateEngines: map[string]render.TemplateEngine{
			"html": pongo2.BuffaloRenderer,
		},

		// HTML layout to be used for all HTML requests:
		HTMLLayout: "application.html",

		// Box containing all of the templates:
		TemplatesBox: packr.NewBox("../templates"),
		AssetsBox:    assetsBox,

		// Add template helpers here:
		Helpers: render.Helpers{},
	})
}