aboutsummaryrefslogtreecommitdiffstats
path: root/pelican-bootstrap3
diff options
context:
space:
mode:
Diffstat (limited to 'pelican-bootstrap3')
-rw-r--r--pelican-bootstrap3/templates/base.html9
1 files changed, 7 insertions, 2 deletions
diff --git a/pelican-bootstrap3/templates/base.html b/pelican-bootstrap3/templates/base.html
index 7c041d5..6362e21 100644
--- a/pelican-bootstrap3/templates/base.html
+++ b/pelican-bootstrap3/templates/base.html
@@ -105,7 +105,7 @@
<div class="navbar {% if BOOTSTRAP_NAVBAR_INVERSE %}navbar-inverse{% else %}navbar-default{% endif %} navbar-fixed-top" role="navigation">
<div class="container{% if BOOTSTRAP_FLUID %}-fluid{% endif %}">
<div class="navbar-header">
- {% if MENUITEMS or (PAGES and DISPLAY_PAGES_ON_MENU) or (categories and DISPLAY_CATEGORIES_ON_MENU) %}
+ {% if MENUITEMS or (pages and DISPLAY_PAGES_ON_MENU) or (categories and DISPLAY_CATEGORIES_ON_MENU) %}
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
@@ -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 %}