Closed ClmntBcqt closed 2 months ago
Also, it would be interesting to put all standard filters in a unique place
To avoid to import files in settings.py
, we give the string of module to import :
JFME_ADDITIONAL_JINJA2_FILTERS = {"encode_base_64" : "jssg.templatetags.base_64.base64encode", "readtime_markdown": "readtime.of_markdown"}
JFME_ADDITIONAL_JINJA2_FILTERS = {"encode_base_64" : "jssg.templatetags.base_64.base64encode", "readtime_markdown": "readtime.of_markdown"}
jfmengine/jssg/templatetags/
is the standard directory to put filters and functions.
Merged in #54
1. Index page configuration
Currently we need to configure the index page (page at URL "/") in
views.py
, inIndexView
class by changing the lines :Expected : It would be clearer and easier if we could configure the
slug
andfolder
of index page as a setting insettings.py
. For instance to configure the index view with the pagecontent/pages/fr/index/home.md
that has the slugaccueil
:2. Add jinja2 filters and functions
Currently the users can't add Jinja2 filters or functions unless modify the file
jinja2.py
. Expected : It could be useful to add settingsJFME_ADDITIONAL_JINJA2_FILTERS
andJFME_ADDITIONAL_JINJA2_FUNCTIONS
For instance insettings.py
:Then in templates :