Browse files

using get_context() method in all Page subclasses

  • Loading branch information...
1 parent ae88974 commit 0e99569caa51a5c436c6c326ed6060189bce9c2c @joshourisman committed Feb 10, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 rabbitfish/pages.py
View
6 rabbitfish/pages.py
@@ -24,7 +24,7 @@ def render_to_string(self):
print("Rendering page {0} with {1}.".format(self.name, self.template))
template = env.get_template(self.template)
content = yaml.load(open("content/{}.yaml".format(self.name)))
- return template.render(**content)
+ return template.render(self.get_context(object=content))
def render_to_output(self):
if not os.path.exists(self.directory):
@@ -48,7 +48,7 @@ def render_to_string(self):
pages = []
for content in content_list:
- html = template.render({'object': content})
+ html = template.render(self.get_context(object=content))
url_context = {
'slug': content['slug'],
}
@@ -100,7 +100,7 @@ def render_to_string(self):
page = content_list.__next__()
page['url'] = self.get_page_url(page)
index.append(page)
- return template.render({'object_list': index})
+ return template.render(self.get_context(object_list=index))
def render_to_output(self, dynamic_pages):
self.dynamic_pages = dynamic_pages

0 comments on commit 0e99569

Please sign in to comment.