From c46ccd3484faed63b9a04e0bf9cb7a0f3d9334f0 Mon Sep 17 00:00:00 2001 From: PLanCompS <62553846+plancomps-admin@users.noreply.github.com> Date: Sat, 25 Apr 2020 14:53:45 +0200 Subject: [PATCH] Made case-insenstive sorting the default Added a configuration option to determine whether the sort order is case-sensitive. The default is case-insensitive. To test: - open `/just-the-docs/docs/utilities/` in the browser, and check that the navigation links in `Utilities` are sorted alphabetically; - in `docs/utilities/layout.md', change the preamble to `title: layout`, and check that the links in `Utilities` are still sorted alphabetically; - add `nav_sort: case_sensitive` in the configuration file, and check that the link to `layout` is now listed last under `Utilities`. --- _config.yml | 4 ++++ _includes/nav.html | 13 ++++++++++--- docs/navigation-structure.md | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/_config.yml b/_config.yml index a090670..92ab71e 100644 --- a/_config.yml +++ b/_config.yml @@ -38,6 +38,10 @@ aux_links: "Just the Docs on GitHub": - "//github.com/pmarsceill/just-the-docs" +# Sort order for navigation links +nav_sort: case_insensitive # default, equivalent to nil +# nav_sort: case_sensitive # Capital letters sorted before lowercase + # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." diff --git a/_includes/nav.html b/_includes/nav.html index a691f4f..ec6c786 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -1,8 +1,15 @@