%import shlex, unicodedata, os
%number = (query['page'] - 1)*config['perpage'] + i + 1
#{{number}}
%url = d['url'].replace(b'file://', b'') %for dr, prefix in config['mounts'].items(): %url = url.replace(dr.encode('utf-8'), prefix.encode('utf-8')) %end
%if 'title_link' in config and config['title_link'] != 'download': %if config['title_link'] == 'open': {{d['label']}} %elif config['title_link'] == 'preview': {{d['label']}} %end %else: {{d['label']}} %end
%if len(d['ipath']) > 0:
[{{d['ipath']}}]
%end %if 'author' in d and len(d['author']) > 0:
{{d['author']}}
%end
%urllabel = os.path.dirname(d['url'].replace(b'file://', b'')) %for r in config['dirs']: %urllabel = urllabel.replace(r.encode('utf-8').rsplit(b'/',1)[0] + b'/' , b'') %end {{urllabel}}
{{d['time']}}
{{!d['snippet']}}