Renamed get_staticsite_paths to get_static_site_paths

pull/249/head
Karl Hobley 2014-05-20 12:39:23 +01:00
rodzic 9564cbf39f
commit c194a55304
3 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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):

Wyświetl plik

@ -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):