From a4b2d809f04ab8c9e85f0391201e69fec9bbc238 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Thu, 2 Aug 2018 16:14:40 -0400 Subject: [PATCH] jinja filter for getting an icon's SVG file contents --- atst/app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/atst/app.py b/atst/app.py index ca6ad7e2..d1213b27 100644 --- a/atst/app.py +++ b/atst/app.py @@ -57,6 +57,11 @@ def make_flask_callbacks(app): "atat_permissions": [], } + @app.template_filter('iconSvg') + def iconSvg(name): + with open('static/icons/'+name+'.svg') as contents: + return contents.read() + def map_config(config): return {