aboutsummaryrefslogtreecommitdiffstats
path: root/pelican-bootstrap3
diff options
context:
space:
mode:
authorMarc-Antoine Parent <maparent@acm.org>2016-10-22 17:39:52 -0400
committerMarc-Antoine Parent <maparent@acm.org>2016-10-22 17:39:52 -0400
commit6775fe99e672a70682b863981f53737690eb30ef (patch)
tree02039028ec18751bcc9f7be20515c4ef7b4afbe9 /pelican-bootstrap3
parent7e95f5c996ad7a15716e95a79ddc8564faecd22b (diff)
downloadpelican-themes-6775fe99e672a70682b863981f53737690eb30ef.tar.gz
allow sorting pages. Also allow url-less page.
Diffstat (limited to 'pelican-bootstrap3')
-rw-r--r--pelican-bootstrap3/templates/base.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/pelican-bootstrap3/templates/base.html b/pelican-bootstrap3/templates/base.html
index 9c292e6..6362e21 100644
--- a/pelican-bootstrap3/templates/base.html
+++ b/pelican-bootstrap3/templates/base.html
@@ -123,11 +123,16 @@
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
+ {% if not PAGES_SORT_ATTRIBUTE -%}
+ {% set PAGES_SORT_ATTRIBUTE = 'title' %}
+ {%- endif %}
{% if DISPLAY_PAGES_ON_MENU %}
- {% for p in pages %}
+ {% for p in pages | sort(attribute=PAGES_SORT_ATTRIBUTE) %}
+ {% if p.url %}
<li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">
{{ p.menulabel|default(p.title) }}
</a></li>
+ {% endif %}
{% endfor %}
{% endif %}
{% if DISPLAY_CATEGORIES_ON_MENU %}