mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Use latest_revision_created_at in sitemap gen
Much faster than looking it up manually for every page in the site
This commit is contained in:
parent
d770e94687
commit
7659bf23d3
@ -794,12 +794,10 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed
|
|||||||
return ['/']
|
return ['/']
|
||||||
|
|
||||||
def get_sitemap_urls(self):
|
def get_sitemap_urls(self):
|
||||||
latest_revision = self.get_latest_revision()
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
'location': self.full_url,
|
'location': self.full_url,
|
||||||
'lastmod': latest_revision.created_at if latest_revision else None
|
'lastmod': self.latest_revision_created_at
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user