gofiber/template

django template fails to load extends tags

Closed this issue · 6 comments

I am writing an app that requires templates and switched to django because handlebars and html templates do not support template inheritance. However <% extends TAG in pongo2 seems to be failing because the baseDir is set to "/" and it uses http.ioFS Open() and that goes to embed.FS Open()... validation fails:

go/src/io/fs/fs.go

// ValidPath reports whether the given path name
// is valid for use in a call to Open.
//
// Path names passed to open are UTF-8-encoded,
// unrooted, slash-separated sequences of path elements, like “x/y/z”.
// Path names must not contain an element that is “.” or “..” or the empty string,
// except for the special case that the root directory is named “.”.
// Paths must not start or end with a slash: “/x” and “x/” are invalid.
//
// Note that paths are slash-separated on all systems, even Windows.
// Paths containing other characters such as backslash and colon
// are accepted as valid, but those characters must never be
// interpreted by an FS implementation as path element separators.
func ValidPath(name string) bool {

Seems you have fixed the issue:
10138ff

However there is no official release of this fix. TAG?

Wrote an extends sample https://github.com/luisgarciaalanis/gofiber-template-django-extends/tree/main
Found the fix only to realize its already fixed but not released.

FYI: #94

Thanks for the reply,

do you have an ETA for the next release? is it safe to use latest for the time being?

we will release in the next few days and hopefully faster and more often in the future.

Thanks for the GREAT work :)