weblorg
weblorg copied to clipboard
feat: Custom filters via weblorg-site
Add custom templatel filters via weblorg-site
. The :filters
option takes a list of cons providing the filter name and function. This matches the API outlined in #43.
I'm new to Emacs Lisp so happy to hear any feedback.
Example use:
(defun greeter (name) (concat "Hello, " name "!"))
(weblorg-site
:filters `(("greet" . greeter)
("greet_twice" . (lambda (name) (concat (greeter name) (greeter name))))))
And in the template:
<p>{{ "world" | greet }}</p>
<p>{{ "world" | greet_twice }}</p>