Add PAGES to the context

This commit is contained in:
Alexis Metaireau 2010-12-14 15:48:35 +00:00
commit 5748a91ad7
2 changed files with 3 additions and 1 deletions

View file

@ -85,3 +85,5 @@ Pages
If you create a folder named `pages`, all the files in it will be used to
generate static pages.
Then, use the `DISPLAY_PAGES_ON_MENU` setting, which will add all the pages to
the menu.

View file

@ -184,13 +184,13 @@ class PagesGenerator(Generator):
self.pages.append(page)
self._update_context(('pages', ))
self.context['PAGES'] = self.pages
def generate_output(self, writer):
templates = self.get_templates()
for page in self.pages:
writer.write_file('pages/%s' % page.url, templates['page'],
self.context, page=page)
self._update_context(('pages',))
class StaticGenerator(Generator):