From c194a55304a5e9b45cf53f133502cfdcb820ec42 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 20 May 2014 12:39:23 +0100 Subject: [PATCH] Renamed get_staticsite_paths to get_static_site_paths --- docs/static_site_generation.rst | 6 +++--- wagtail/contrib/wagtailmedusa/renderers.py | 2 +- wagtail/wagtailcore/models.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/static_site_generation.rst b/docs/static_site_generation.rst index dbdf40eb22..66bd23ff56 100644 --- a/docs/static_site_generation.rst +++ b/docs/static_site_generation.rst @@ -53,13 +53,13 @@ For example, lets say we have a Blog Index which uses pagination. We can overrid Rendering pages which use custom routing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -For page types that override the route method, we need to let django medusa know which URLs it responds on. This is done by overriding the 'get_staticsite_paths' method to make it yield one string per URL path. +For page types that override the route method, we need to let django medusa know which URLs it responds on. This is done by overriding the 'get_static_site_paths' method to make it yield one string per URL path. For example, the BlogIndex above would need to yield one URL for each page of results: .. code:: python - def get_staticsite_paths(self): + def get_static_site_paths(self): # Get page count page_count = ... @@ -68,7 +68,7 @@ For example, the BlogIndex above would need to yield one URL for each page of re yield '/%d/' % (page + 1) # Yield from superclass - for path in super(BlogIndex, self).get_staticsite_paths(): + for path in super(BlogIndex, self).get_static_site_paths(): yield path diff --git a/wagtail/contrib/wagtailmedusa/renderers.py b/wagtail/contrib/wagtailmedusa/renderers.py index ee0ccf4f86..950e13a146 100644 --- a/wagtail/contrib/wagtailmedusa/renderers.py +++ b/wagtail/contrib/wagtailmedusa/renderers.py @@ -12,7 +12,7 @@ class PageRenderer(StaticSiteRenderer): return [] # Return list of paths - return site.root_page.get_staticsite_paths() + return site.root_page.get_static_site_paths() class DocumentRenderer(StaticSiteRenderer): diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index d453684bd4..17b88198e4 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -622,7 +622,7 @@ class Page(MP_Node, ClusterableModel, Indexed): """ return self.serve(self.dummy_request()) - def get_staticsite_paths(self): + def get_static_site_paths(self): """ This is a generator of URL paths to feed into a static site generator Override this if you would like to create static versions of subpages @@ -632,7 +632,7 @@ class Page(MP_Node, ClusterableModel, Indexed): # Yield paths for child pages for child in self.get_children().live(): - for path in child.specific.get_staticsite_paths(): + for path in child.specific.get_static_site_paths(): yield '/' + child.slug + path def get_ancestors(self, inclusive=False):