ソースを参照

Update sitemap plugin to place nicely with modified metadata

modified is a string in pelican <= 3.3 and datetime > 3.3

Sitemap used to treat it as string.
Talha Mansoor 11 年 前
コミット
df9b772f3e
共有1 個のファイルを変更した2 個の追加0 個の削除を含む
  1. 2 0
      sitemap/sitemap.py

+ 2 - 0
sitemap/sitemap.py

@@ -158,6 +158,8 @@ class SitemapGenerator(object):
 
     def get_date_modified(self, page, defalut):
         if hasattr(page, 'modified'):
+            if isinstance(getattr(page, 'modified'), datetime):
+                return getattr(page, 'modified')
             return get_date(getattr(page, 'modified'))
         else:
             return defalut