aboutsummaryrefslogtreecommitdiffstats
path: root/pelican-bootstrap3/templates/base.html
diff options
context:
space:
mode:
authorJustin Mayer <entroP@gmail.com>2016-10-22 16:01:10 -0600
committerGitHub <noreply@github.com>2016-10-22 16:01:10 -0600
commit336b10cce6b317ea829c55592239fc326bb4733c (patch)
tree02039028ec18751bcc9f7be20515c4ef7b4afbe9 /pelican-bootstrap3/templates/base.html
parent6e787e9774ddad1b86ce2c3087a4490df457e004 (diff)
parent6775fe99e672a70682b863981f53737690eb30ef (diff)
downloadpelican-themes-336b10cce6b317ea829c55592239fc326bb4733c.tar.gz
Merge pull request #447 from maparent/master
pelican-bootstrap3: various improvements
Diffstat (limited to 'pelican-bootstrap3/templates/base.html')
-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 %}