1
0
Fork 0
mirror of synced 2024-09-29 16:51:22 +13:00

Update archivebox/index.py

Co-Authored-By: Nick Sweeting <git@sweeting.me>
This commit is contained in:
Julian Berman 2019-10-19 12:47:42 -04:00 committed by GitHub
parent eb641b3e35
commit 2e4b506c21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,7 +187,7 @@ def patch_links_index(link, out_dir=OUTPUT_DIR):
# Patch HTML index
html_path = os.path.join(out_dir, 'index.html')
with open(html_path, 'r') as html_file:
html = [line[:-1] for line in html_file]
html = html_file.read().splitlines()
for idx, line in enumerate(html):
if title and ('<span data-title-for="{}"'.format(link['url']) in line):
html[idx] = '<span>{}</span>'.format(title)