Simple django templatetag to display SVG
icons in your django application.
Icon paths will loaded from a provided JSON
file, formatted according the icomoon format.
More info: Icomoon website
Installation from pypi via pip
pip install django-svg-icons
In your django project add svg_icons
to your installed apps and set the SVG_ICONS_SOURCE_FILE
setting to your source file.
INSTALLED_APPS = [
# ...
'svg_icons',
]
SVG_ICONS_SOURCE_FILE = '/path/to/source_file.json'
In your templates you can load the templatetag and start including your icons.
{% load svg_icons %}
{% icon 'icon_name' %}
The templatetag accepts some kwargs for icon configuration as well.
<svg>
objectAll kwargs are optional, when not provided the deaults are used.
{% icon 'icon_name' size=50 className="css classnames" %}