Merge pull request #62 from maparent/choose_page_order

allow to choose a page sort attribute other than alphabetical
This commit is contained in:
Alexandre Vicenzi 2016-11-21 08:56:57 -02:00 committed by GitHub
commit 8546bd58a6

View file

@ -90,7 +90,10 @@
{% if pages or LINKS %}
<nav>
<ul class="list">
{% for page in pages|sort(attribute='title') %}
{% if not PAGES_SORT_ATTRIBUTE -%}
{% set PAGES_SORT_ATTRIBUTE = 'title' %}
{%- endif %}
{% for page in pages|sort(attribute=PAGES_SORT_ATTRIBUTE) %}
<li><a href="{{ SITEURL }}/{{ page.url }}#{{ page.slug }}">{{ page.title }}</a></li>
{% endfor %}