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):
|
if not is_valid_content(page, f):
|
||||||
continue
|
continue
|
||||||
self.pages.append(page)
|
self.pages.append(page)
|
||||||
|
|
||||||
|
context['PAGES'] = self.pages
|
||||||
|
|
||||||
def process(self, context, generator):
|
def process(self, context, generator):
|
||||||
templates = generator.get_templates()
|
templates = generator.get_templates()
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ _DEFAULT_CONFIG = {'PATH': None,
|
||||||
'FEED': 'feeds/all.atom.xml',
|
'FEED': 'feeds/all.atom.xml',
|
||||||
'CATEGORY_FEED': 'feeds/%s.atom.xml',
|
'CATEGORY_FEED': 'feeds/%s.atom.xml',
|
||||||
'SITENAME': 'A Pelican Blog',
|
'SITENAME': 'A Pelican Blog',
|
||||||
|
'DISPLAY_PAGES_ON_MENU': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
def read_settings(filename):
|
def read_settings(filename):
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,11 @@
|
||||||
{% for title, link in MENUITEMS %}
|
{% for title, link in MENUITEMS %}
|
||||||
<li><a href="{{ link }}">{{ title }}</a></li>
|
<li><a href="{{ link }}">{{ title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for title, link in PAGES %}
|
{% if DISPLAY_PAGES_ON_MENU %}
|
||||||
<li><a href="{{ SITEURL }}/{{ link }}">{{ title }}</a></li>
|
{% for page in PAGES %}
|
||||||
|
<li><a href="{{ SITEURL }}/pages/{{ page.url }}">{{ page.title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% for cat, null in categories %}
|
{% for cat, null in categories %}
|
||||||
<li {% if cat == category %}class="active"{% endif %}><a href="{{ SITEURL }}/category/{{ cat }}.html">{{ cat }}</a></li>
|
<li {% if cat == category %}class="active"{% endif %}><a href="{{ SITEURL }}/category/{{ cat }}.html">{{ cat }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% block content_title %}{% endblock %}
|
{% block content_title %}{% endblock %}
|
||||||
|
{% if articles %}
|
||||||
{% for article in articles %}
|
{% for article in articles %}
|
||||||
{% if loop.index == 1 %}
|
{% if loop.index == 1 %}
|
||||||
<aside id="featured" class="body"><article>
|
<aside id="featured" class="body"><article>
|
||||||
|
|
@ -49,4 +50,12 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol><!-- /#posts-list -->
|
</ol><!-- /#posts-list -->
|
||||||
</section><!-- /#content -->
|
</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 %}
|
{% endblock content %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue