1. David Chambers
  2. Mango

Commits

David Chambers  committed b7e9cad

Added `include_pages=True` to have common context variable `documents` contain pages as well as posts.

  • Participants
  • Parent commits 0243c30
  • Branches default

Comments (0)

Files changed (2)

File utils.py

View file
     posts.sort(key=lambda post: post.datetime, reverse=reverse)
     pages.sort(key=lambda page: page.title)
 
+    documents = posts
     if include_pages:
-        return pages + posts
+        documents += pages
 
-    return posts
+    return documents
 
 def documents(path_to_posts=PATH_TO_POSTS, include_pages=False):
     """

File views.py

View file
     path_to_js, js = getattr(settings, 'JS', (None, []))
     return {
         'archives': utils.archives(),
-        'documents': utils.documents(),
+        'documents': utils.documents(include_pages=True),
         'settings': settings,
         'stylesheets': [dict(media=media, href=path_to_css.lstrip('.')+filename) for media, stylesheets in css for filename in stylesheets],
         'scripts': [dict(src=path_to_js.lstrip('.')+filename) for filename in js],