Add static pages listing and options.

This commit is contained in:
Alexis Metaireau 2010-11-05 02:05:00 +00:00
commit f7cbef6393
4 changed files with 16 additions and 2 deletions

View file

@ -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()

View file

@ -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):

View file

@ -30,9 +30,11 @@
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% for title, link in PAGES %}
<li><a href="{{ SITEURL }}/{{ link }}">{{ title }}</a></li>
{% if DISPLAY_PAGES_ON_MENU %}
{% for page in PAGES %}
<li><a href="{{ SITEURL }}/pages/{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
{% endif %}
{% for cat, null in categories %}
<li {% if cat == category %}class="active"{% endif %}><a href="{{ SITEURL }}/category/{{ cat }}.html">{{ cat }}</a></li>
{% endfor %}

View file

@ -1,6 +1,7 @@
{% extends "base.html" %}
{% block content %}
{% block content_title %}{% endblock %}
{% if articles %}
{% for article in articles %}
{% if loop.index == 1 %}
<aside id="featured" class="body"><article>
@ -49,4 +50,12 @@
{% endfor %}
</ol><!-- /#posts-list -->
</section><!-- /#content -->
{% else %}
<section id="content" class="body">
<h2>Pages</h2>
{% for page in PAGES %}
<li><a href="{{ SITEURL }}/pages/{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
</section>
{% endif %}
{% endblock content %}