From 4fc59a578fc987ea2dc67455c22bc5c356a0218b Mon Sep 17 00:00:00 2001 From: PLanCompS <18308236+pdmosses@users.noreply.github.com> Date: Tue, 11 Aug 2020 18:25:58 +0200 Subject: [PATCH] Separate sorting of numbers and strings for navigation order The values of `title` and `nav_order` can be numbers or strings. Jekyll gives build failures when sorting on mixtures of different types, so numbers and strings need to be sorted separately. Here, numbers are sorted by their values, and come before all strings. An omitted `nav_order` value is equivalent to the page's `title` value (except that a numerical `title` value is treated as a string). The case-sensitivity of string sorting is determined by `site.nav_sort`. --- _config.yml | 2 +- _includes/nav.html | 59 ++++++++++++++++++++++++++----- docs/tests/42.md | 11 ++++++ docs/{ => tests}/untitled-test.md | 0 4 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 docs/tests/42.md rename docs/{ => tests}/untitled-test.md (100%) diff --git a/_config.yml b/_config.yml index fd71b51..32309d8 100644 --- a/_config.yml +++ b/_config.yml @@ -19,7 +19,7 @@ baseurl: "/just-the-docs" # the subpath of your site, e.g. /blog url: "https://pmarsceill.github.io" # the base hostname & protocol for your site, e.g. http://example.com permalink: pretty -exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"] +exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile", "docs/tests/"] # Set a path/url to a logo that will be displayed instead of the title #logo: "/assets/images/just-the-docs.png" diff --git a/_includes/nav.html b/_includes/nav.html index d74c17c..748b6ce 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -1,15 +1,58 @@