Commits

Steve Losh committed ccd79c8

Update the documentation to reflect the filter import feature.

Comments (0)

Files changed (2)

 ``blatter.ini``.  Any of the directories can be changed to suit your
 tastes.
 
+Custom Jinja filters can be also be imported.  Say you have a filter called ``uppercase`` in a ``filters.py`` file that you'd like to use.  To import the filter you would add the following to your ``blatter.ini`` file:
+
+  [filter.uppercase]
+  name=uppercase
+  function=filters.uppercase
+
+The ``name`` option is the name that Jinja will use to refer to the filter in your templates.  The ``function`` option is the full module path to the function you want to import as a filter.
+
 
 Nested Sites and Chaining Blatters
 ----------------------------------

blatter/__init__.py

 dynamic_dir=site
 output_dir=out
 
+# filter options can be used to import custom Jinja filters
+# 'name' is what the filter will be called by in Jinja tags
+# 'function' is the (module) path to the function.
+#[filter.mycustomfilter]
+#name=custom_filter
+#function=module.filters.custom_filter_function
+
 # 'publish' target can be configured or use --destination
 #publish_location=some.host:/remote/path/
 #publish_location=/local/path