diff --git a/render.go b/render.go index 3a73277..c59d1fb 100644 --- a/render.go +++ b/render.go @@ -3,6 +3,7 @@ package ginpongo2 import ( "fmt" "net/http" + "strings" "github.com/flosch/pongo2" "github.com/gin-gonic/gin/render" @@ -49,6 +50,9 @@ func New(basedir string, debug bool) *Pongo { p := new(Pongo) p.set = pongo2.NewSet("html") p.set.Debug = debug + if !strings.HasSuffix(basedir, "/") { + basedir = basedir + "/" + } p.basedir = basedir return p }