github.com/wawandco/ox@v0.13.6-0.20230809142027-913b3d837f2a/plugins/tools/ox/render/templates/render.go.tmpl (about)

     1  package render
     2  
     3  import (
     4  	"{{.}}/app/templates"
     5  	"{{.}}/public"
     6  	"github.com/gobuffalo/buffalo/render"
     7  	"github.com/wawandco/ox/pkg/buffalotools"
     8  )
     9  
    10  // Engine for rendering across the app, it provides
    11  // the base for rendering HTML, JSON, XML and other formats
    12  // while also defining thing like the base layout.
    13  var Engine = render.New(render.Options{
    14  	HTMLLayout:   "application.plush.html",
    15  	TemplatesFS:  templates.FS(),
    16  	AssetsFS:     public.FS(),
    17  	Helpers:      Helpers,
    18  })
    19  
    20  // Helpers available for the plush templates, there are 
    21  // some helpers that are injected by Buffalo but this is 
    22  // the list of custom Helpers.
    23  var Helpers = map[string]interface{}{
    24  	// partialFeeder is the helper used by the render engine
    25  	// to find the partials that will be used, this is important
    26  	"partialFeeder": buffalotools.NewPartialFeeder(templates.FS()),
    27  }