Refactor how jinja filters are added

This commit is contained in:
Patrick Smith
2018-08-20 11:00:11 -04:00
parent fda3046832
commit 2f62aebd57
2 changed files with 9 additions and 6 deletions

7
atst/filters.py Normal file
View File

@@ -0,0 +1,7 @@
def iconSvg(name):
with open('static/icons/'+name+'.svg') as contents:
return contents.read()
def register_filters(app):
app.jinja_env.filters['iconSvg'] = iconSvg