From 935dcac0c75833a888cba7e57d9a7c103e186d7d Mon Sep 17 00:00:00 2001
From: Nick Sweeting <git@nicksweeting.com>
Date: Tue, 19 Feb 2019 02:40:02 -0500
Subject: [PATCH] fix title showing up as None in some UI spots

---
 archivebox/index.py | 1 +
 archivebox/util.py  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/archivebox/index.py b/archivebox/index.py
index cc3ccf20..26811995 100644
--- a/archivebox/index.py
+++ b/archivebox/index.py
@@ -143,6 +143,7 @@ def write_html_link_index(out_dir, link):
         f.write(Template(link_html).substitute({
             **link,
             **link['latest'],
+            'title': link['title'] or link['url'],
             'type': link['type'] or 'website',
             'tags': link['tags'] or 'untagged',
             'bookmarked': datetime.fromtimestamp(float(link['timestamp'])).strftime('%Y-%m-%d %H:%M'),
diff --git a/archivebox/util.py b/archivebox/util.py
index 6af7160f..6b41c2e1 100644
--- a/archivebox/util.py
+++ b/archivebox/util.py
@@ -526,6 +526,7 @@ def derived_link_info(link):
         'screenshot_link': 'archive/{timestamp}/screenshot.png'.format(**link),
         'dom_link': 'archive/{timestamp}/output.html'.format(**link),
         'archive_org_url': 'https://web.archive.org/web/{base_url}'.format(**link),
+        'title': link['title'] or link['url'],
     }
 
     # PDF and images are handled slightly differently