Merge pull request #62 from maparent/choose_page_order
allow to choose a page sort attribute other than alphabetical
This commit is contained in:
commit
8546bd58a6
1 changed files with 4 additions and 1 deletions
|
@ -90,7 +90,10 @@
|
||||||
{% if pages or LINKS %}
|
{% if pages or LINKS %}
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="list">
|
<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>
|
<li><a href="{{ SITEURL }}/{{ page.url }}#{{ page.slug }}">{{ page.title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue