Add `basename` and `dirname` filters for Jinja2
Closed this issue · 1 comments
uwefladrich commented
These filters are often useful.
uwefladrich commented
Implement like
def basename(path):
return os.path.basename(path)
def dirname(path):
return os.path.dirname(path)
and then
environment.filters['basename'] = basename
environment.filters['dirname'] = dirname