mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add static pages listing and options.
This commit is contained in:
parent
c989db50c9
commit
f7cbef6393
4 changed files with 16 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue