From f7cbef6393095ed85c327484616d209a6e2e01fb Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 5 Nov 2010 02:05:00 +0000 Subject: [PATCH] Add static pages listing and options. --- pelican/processors.py | 2 ++ pelican/settings.py | 1 + pelican/themes/notmyidea/templates/base.html | 6 ++++-- pelican/themes/notmyidea/templates/index.html | 9 +++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pelican/processors.py b/pelican/processors.py index 564978cc..c23af3f5 100644 --- a/pelican/processors.py +++ b/pelican/processors.py @@ -106,6 +106,8 @@ class PagesProcessor(Processor): if not is_valid_content(page, f): continue self.pages.append(page) + + context['PAGES'] = self.pages def process(self, context, generator): templates = generator.get_templates() diff --git a/pelican/settings.py b/pelican/settings.py index 814850f8..6c5449d1 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -10,6 +10,7 @@ _DEFAULT_CONFIG = {'PATH': None, 'FEED': 'feeds/all.atom.xml', 'CATEGORY_FEED': 'feeds/%s.atom.xml', 'SITENAME': 'A Pelican Blog', + 'DISPLAY_PAGES_ON_MENU': True, } def read_settings(filename): diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index f6387ac7..b5a845b3 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -30,9 +30,11 @@ {% for title, link in MENUITEMS %}
  • {{ title }}
  • {% endfor %} - {% for title, link in PAGES %} -
  • {{ title }}
  • + {% if DISPLAY_PAGES_ON_MENU %} + {% for page in PAGES %} +
  • {{ page.title }}
  • {% endfor %} + {% endif %} {% for cat, null in categories %}
  • {{ cat }}
  • {% endfor %} diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index e4260302..8ed9fe37 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block content %} {% block content_title %}{% endblock %} +{% if articles %} {% for article in articles %} {% if loop.index == 1 %}