Uh oh!
There was an error while loading. Please reload this page.
Ability to use jinja2 templates added. - #74
Conversation
| return btl.static_file(path, root=root_path) | ||
| if _env != None: | ||
| template = _env.get_template(path[10:]) |
There was a problem hiding this comment.
The setup assumes that templates will be placed inside a directory called "templates". The 10: removed templates/ from the path leaving only the name of the template.
There was a problem hiding this comment.
OK cheers. I will probably tweak it to make the folder name configurable
There was a problem hiding this comment.
When I set it up I tried to do it in a way that if someone didn't want to use templates everything would be the same as before (i.e. no need to specify if templates were used or not). That said if you want to update this to make the template folder configurable I agree that would be better so please do.
AdamGEmerson
commented
Feb 12, 2019
Is there still a plan to merge this PR? I came to check for this feature and lo and behold someone has already done the work! Would love to see jinja templates integrated fully. |
ChrisKnott
commented
Feb 13, 2019
Adam - yes definitely. In fact I'll try and do this tonight. I apologise for slow development at the moment, I haven't had much time and been focussing on better Electron support |
AdamGEmerson
commented
Feb 13, 2019
No worries! I can't imagine maintaining a project like this while also balancing work, life, etc. I'm really liking eel so far. Thanks for your hard work! |
ChrisKnott
commented
Feb 13, 2019
@sanders41 I'm just going to make a few changes to this so that Jinja2 is not actually a dependency for people who don't need it |
Merged, thanks for your contribution Paul. I might tidy this up in a couple of months. I am not familiar enough with Jinja2 myself at the moment to know best practices etc. |
This is in reference to issue #70. It adds the ability to use janja2 templates.