Don't crash on self.title if no soup.head.title.
This commit is contained in:
parent
13d5534dc0
commit
93b6cb9f75
1 changed files with 4 additions and 1 deletions
|
@ -76,7 +76,10 @@ class Article:
|
||||||
css=writing_rootdir.with_child('css').with_child('dark.css').absolute_path,
|
css=writing_rootdir.with_child('css').with_child('dark.css').absolute_path,
|
||||||
return_soup=True,
|
return_soup=True,
|
||||||
)
|
)
|
||||||
|
if self.soup.head.title:
|
||||||
self.title = self.soup.head.title.get_text()
|
self.title = self.soup.head.title.get_text()
|
||||||
|
else:
|
||||||
|
self.title = self.md_file.basename
|
||||||
|
|
||||||
tag_links = self.soup.find_all('a', {'class': 'tag_link'})
|
tag_links = self.soup.find_all('a', {'class': 'tag_link'})
|
||||||
for tag_link in tag_links:
|
for tag_link in tag_links:
|
||||||
|
|
Loading…
Reference in a new issue