Skip to content

Commit

Permalink
Update sitemap plugin to place nicely with modified metadata
Browse files Browse the repository at this point in the history
modified is a string in pelican <= 3.3 and datetime > 3.3

Sitemap used to treat it as string.
  • Loading branch information
talha131 committed Nov 9, 2013
1 parent 3b47373 commit df9b772
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sitemap/sitemap.py
Expand Up @@ -158,6 +158,8 @@ def write_url(self, page, fd):

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
Expand Down

0 comments on commit df9b772

Please sign in to comment.