deligenius / view-engine

🚀A Template View Engine for Deno frameworks
MIT License
54 stars 16 forks source link

viewRoot is not used when extending templates #4

Closed ThauEx closed 4 years ago

ThauEx commented 4 years ago

Template engines like denjucks support extending templates, but when using this, the full template path from the project root needs to get passed. When for example setting a viewRoot of ./templates, using {% extend 'some_template.html' %} won't work, because some_template.html(which is in the same folder as the current template) won't be found, but when using {% extend 'templates/some_template.html'%}, it will work. I don't know, how it's for the other template engines, but denjucks supports setting the template root via denjucks.configure("./public");. This could be defined inside the engine file and would avoid using the viewRoot inside the adapters.

gjuoun commented 4 years ago

Fixed 19e3970748c64d8437a61ea9d81b9af70a665f9d

ThauEx commented 4 years ago

Thank you very much.