@register.tag
def get_pages(parser, token):
    # Validate args.
    try:
        tag_name, args = token.contents.split(None, 1)
    except ValueError:
        var_name = 'pages'
    else:
        args = args.split()
        if len(args) == 2 and args[0] == 'as':
            var_name = args[1]
        else:
            msg = 'Invalid arguments for %r tag' % tag_name
            raise template.TemplateSyntaxError(msg)
    # Call the node.
    return GetPagesNode(var_name)
Add to context the list of page links.
dataset/ETHPy150Open frankban/django-endless-pagination/endless_pagination/templatetags/endless.py/get_pages