diff options
author | Marc-Antoine Parent <maparent@acm.org> | 2016-10-22 17:39:52 -0400 |
---|---|---|
committer | Marc-Antoine Parent <maparent@acm.org> | 2016-10-22 17:39:52 -0400 |
commit | 6775fe99e672a70682b863981f53737690eb30ef (patch) | |
tree | 02039028ec18751bcc9f7be20515c4ef7b4afbe9 /pelican-bootstrap3/templates | |
parent | 7e95f5c996ad7a15716e95a79ddc8564faecd22b (diff) | |
download | pelican-themes-6775fe99e672a70682b863981f53737690eb30ef.tar.gz |
allow sorting pages. Also allow url-less page.
Diffstat (limited to 'pelican-bootstrap3/templates')
-rw-r--r-- | pelican-bootstrap3/templates/base.html | 7 |
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 %} |