Serotonin Storm

source>source>template.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
def breadcrumbs(path):
    links,base = [],[]
    if path.startswith('/'): path = path[1:]
    if path.endswith('/'): path = path[:-1]
    for part in path.split('/'):
        if not part: continue
        base.append(part)
        links.append(('/'.join(base),part))
    return '&gt;'.join(['<a href="/%s/">%s</a>' % i for i in links])
    
breadcrumbs.function = 1