mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add PAGES to the context
This commit is contained in:
parent
e0e62d8b8e
commit
5748a91ad7
2 changed files with 3 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue