diff --git a/page.py b/page.py index 949d192..f4d5e29 100755 --- a/page.py +++ b/page.py @@ -24,7 +24,7 @@ def blog_page_template(): def date_from_filename(filename): return maybe( re.search(r"(?:^|/)([0-9]{4}-[0-9]{2}-[0-9]{2})[^/]+$", filename) - ).group(1).or_none() + ).group(1).or_else(None) def blog_page_metadata(filename): diff --git a/rss.py b/rss.py index 5c1cd76..a0c204f 100755 --- a/rss.py +++ b/rss.py @@ -33,6 +33,8 @@ ITEM_TEMPLATE = """ def iso8601_to_rfc822(iso8601): # pylint: disable=invalid-name + if not iso8601: + return "" y, m, d = map(int, iso8601.split("-")) month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][m] return f"{d} {month} {y} 00:00:00 UTC"