Merge pull request #171 from RiceKab/page-sort-fallback

Using PAGE_ORDER_BY as the default sorting setting.
This commit is contained in:
Alexandre Vicenzi 2019-04-23 12:29:32 +02:00 committed by GitHub
commit 63e3192b27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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