Skip to content

Commit

Permalink
optimize get_lastmod in sitemaps
Browse files Browse the repository at this point in the history
Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 16, 2014
1 parent 756d505 commit e33cc29
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions nikola/plugins/task/sitemap/__init__.py
Expand Up @@ -52,8 +52,6 @@
"""




def get_base_path(base):
"""returns the path of a base URL if it contains one.
Expand Down Expand Up @@ -176,10 +174,9 @@ def scan_locs_task():
}
yield task


def get_lastmod(self, p):
if self.site.invariant:
return datetime.datetime(2014, 1, 1).isoformat().split('T')[0]
if self.site.invariant:
return '2014-01-01'
else:
return datetime.datetime.fromtimestamp(os.stat(p).st_mtime).isoformat().split('T')[0]

Expand Down

0 comments on commit e33cc29

Please sign in to comment.