1. David Chambers
  2. Mango


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
  • Ignore whitespace
     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
  • Ignore whitespace
     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],