summaryrefslogtreecommitdiff
path: root/src/pyssg/sitemap.py
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2021-05-27 21:40:37 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2021-05-27 21:40:37 -0600
commite087c0727560771f45656bff2f628f996a7e82e9 (patch)
tree1e209e6f64a5f3fa3586e3f9d060dda8a0c610ac /src/pyssg/sitemap.py
parentb37ef5689b6f36fa175e168f227920a230376188 (diff)
fix m_datetime bugv0.4.1
Diffstat (limited to 'src/pyssg/sitemap.py')
-rw-r--r--src/pyssg/sitemap.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pyssg/sitemap.py b/src/pyssg/sitemap.py
index e8338cb..410033f 100644
--- a/src/pyssg/sitemap.py
+++ b/src/pyssg/sitemap.py
@@ -34,7 +34,10 @@ class SitemapBuilder:
u_f: str = ''
for p in self.pages:
url: str = f'{self.config.base_url}/{p.name.replace(".md", ".html")}'
- date: str = p.m_datetime.strftime(DFORMAT)
+ if p.m_datetime is not None:
+ date: str = p.m_datetime.strftime(DFORMAT)
+ else:
+ date: str = p.c_datetime.strftime(DFORMAT)
u_f = f'{u_f} <url>\n'
u_f = f'{u_f} <loc>{url}</loc>\n'