Does Jinja2 support template-relative paths e.g. %(here)s/other/template.html, to include other templates relative to the current template\'s place in the files
According to the documentation for jinja2.Environment.join_path(), support for relative template paths is possible by overriding join_path() to implement "template path joining".
class RelEnvironment(jinja2.Environment):
"""Override join_path() to enable relative template paths."""
def join_path(self, template, parent):
return os.path.join(os.path.dirname(parent), template)