Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

Custom jinja2 filters? #157

Open
anjiro opened this issue May 19, 2016 · 0 comments
Open

Custom jinja2 filters? #157

anjiro opened this issue May 19, 2016 · 0 comments

Comments

@anjiro
Copy link

anjiro commented May 19, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant