search: skip pages that do not have any title

This commit is contained in:
Frédéric Péters 2015-12-01 20:26:48 +01:00
parent d01bc8ed95
commit 6faeff8c0a
1 changed files with 2 additions and 0 deletions

View File

@ -97,6 +97,8 @@ def publish_mallard(module, branch, directory):
text = open(page_file).read()
text = re.sub('<title.*type="sort".*</title>', '', text)
titles = re.findall('<title.*>(.*)<\/title>', text)
if not titles:
continue
pages.append({
'id': os.path.basename(page_file).rsplit('.', 1)[0],
'title': remove_tags(titles[0]),