Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateSet.FromCache would get error result when use multi loaders #313

Open
honmaple opened this issue Oct 12, 2022 · 0 comments
Open

Comments

@honmaple
Copy link

I have two loaders, first is NewLocalFileSystemLoader and second is NewFSLoader with embed.FS, when I use FromFile, I could get right result, but FromCache always got error.
From source code https://github.com/flosch/pongo2/blob/master/template_sets.go#L140, I add a debg print

  name = set.resolveFilenameForLoader(loader, tpl, path)
  fd, err = loader.Get(name)
+ fmt.Println(path)

FromFile got abspath and relpath, but FromCache always got abspath, the problem is at https://github.com/flosch/pongo2/blob/master/template_sets.go#L175, why use cleanedFilename with first loader instead of filename?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants