django_baseline/templatetags/helpers.py
def link(url, text='', classes='', target='', get="", **kwargs):
    '''
    Output a link tag.
    '''

    if not (url.startswith('http') or url.startswith('/')):
        # Handle additional reverse args.
        urlargs = {}

        for arg, val in kwargs.items():
            if arg[:4] == "url_":
                urlargs[arg[4:]] = val

        url = reverse(url, kwargs=urlargs)
        if get:
            url += '?' + get

    return html.tag('a', text or url, {
        'class': classes, 'target': target, 'href': url})
def link(url, text='', classes='', target='', get="", **kwargs):
    '''
    Output a link tag.
    '''

    if not (url.startswith('http') or url.startswith('/')):
        # Handle additional reverse args.
        urlargs = {}

        for arg, val in kwargs.items():
            if arg[:4] == "url_":
                urlargs[arg[4:]] = val

        url = reverse(url, kwargs=urlargs)
        if get:
            url += '?' + get

    return html.tag('a', text or url, {
        'class': classes, 'target': target, 'href': url})
Output a link tag.