Fix pagination plugin to work with jinja