Explorar o código

Merge pull request #103 from talha131/fix-sitemap

Update sitemap plugin to play nicely with modified metadata
Justin Mayer %!s(int64=11) %!d(string=hai) anos
pai
achega
6ae722fefd
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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