Thanks to visit codestin.com
Credit goes to github.com

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

Custom jinja2 filters? #157

@anjiro

Description

@anjiro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions