From 6faeff8c0a8c9b1504980d0cb344eb5469130092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 1 Dec 2015 20:26:48 +0100 Subject: [PATCH] search: skip pages that do not have any title --- publish.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/publish.py b/publish.py index cd2d57e..14fbe5c 100755 --- a/publish.py +++ b/publish.py @@ -97,6 +97,8 @@ def publish_mallard(module, branch, directory): text = open(page_file).read() text = re.sub('', '', text) titles = re.findall('(.*)<\/title>', text) + if not titles: + continue pages.append({ 'id': os.path.basename(page_file).rsplit('.', 1)[0], 'title': remove_tags(titles[0]),