mythmon / wok

A static website generator - Toss some content, templates, and media in a pan and fry it up!
http://wok.mythmon.com
Other
113 stars 46 forks source link

Custom jinja2 filters? #157

Open anjiro opened 8 years ago

anjiro commented 8 years ago

I'm evaluating moving from Pelican to Wok, but I have a number of custom jinja2 filters installed in Pelican that I don't want to lose. Is there a Wok mechanism to install custom filters? As an example, I have the following filter:

def ago(dto, *args):
    """Return the number of seconds ago the passed datetime object
    was."""
    return (datetime.now(pytz.timezone(TIMEZONE)) - dto).total_seconds()

to custom sort some entries.