summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2023-05-18 01:05:18 -0500
committerToby Vincent <tobyv13@gmail.com>2023-05-18 01:05:18 -0500
commit2fe577a2e2a9f352277aa7a31f2c883bd3572de2 (patch)
tree460597cca943f0c6c89990ebe060c9069099cf2c
parent43e7fe95a6ce7fb3048d266ab51c7da97a0c051c (diff)
fix: display nav list in sorted order
-rw-r--r--templates/index.html8
1 files changed, 5 insertions, 3 deletions
diff --git a/templates/index.html b/templates/index.html
index 94fe80f..2130278 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -32,11 +32,13 @@
<nav>
<h1>{{ macros::nav_item(name=config.title, url=config.base_url) }}</h1>
<ul>
- {%- set root = get_section(path="_index.md") %}
- {%- for p in root.pages -%}
+ {% set root = get_section(path="_index.md") %}
+ {% set pages = root.pages | sort(attribute="title") %}
+ {% for p in pages %}
<li>{{ macros::nav_item(name=p.title,url=p.permalink) }}</li>
{%- endfor -%}
- {% for p in root.subsections %}
+ {% set subsections = root.subsections | sort %}
+ {% for p in subsections %}
{%- set s = get_section(path=p) %}
<li>{{ macros::nav_item(name=s.title,url=s.permalink) }}</li>
{% endfor %}