From 6660f442b078ab9dc668c010b1e4378297f32b22 Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Fri, 11 Oct 2019 21:40:34 +0100 Subject: [PATCH] Alphabetic navigation order When `nav_order` is omitted, the order of nodes at each menu level (and in the auto-generated TOC) is alphabetical by `title`, instead of random. Any nodes with a specified `nav_order` precede all nodes at that level where it is omitted. Note that `nav_order` fields must have a uniform site-ide type: integers and strings cannot be mixed, otherwise Jekyll reports errors. The implementation filters the ordered and unordered pages from `site.html_pages`, sorts them separately, and concatenates the resulting arrays. --- _includes/nav.html | 8 +++++--- _layouts/default.html | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/_includes/nav.html b/_includes/nav.html index d561a42..a691f4f 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -1,6 +1,8 @@