From cff0254d93ec5c748bd06649f19bfc6cf97a8c28 Mon Sep 17 00:00:00 2001 From: PLanCompS <18308236+pdmosses@users.noreply.github.com> Date: Tue, 11 Aug 2020 20:47:22 +0200 Subject: [PATCH] Update navigation-structure.md Adjusted the documentation to explain how mixtures of numbers and strings are treated by `nav_order`. --- docs/navigation-structure.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/navigation-structure.md b/docs/navigation-structure.md index d5a7504..34e1005 100644 --- a/docs/navigation-structure.md +++ b/docs/navigation-structure.md @@ -25,7 +25,7 @@ By default, all pages will appear as top level pages in the main nav unless a pa ## Ordering pages -To specify a page order, use the `nav_order` parameter in your pages' YAML front matter. +To specify a page order, you can use the `nav_order` parameter in your pages' YAML front matter. #### Example {: .no_toc } @@ -38,12 +38,13 @@ nav_order: 4 --- ``` -The specified `nav_order` parameters on a site should be all integers or all strings. -Pages without a `nav_order` parameter are ordered alphabetically by their `title`, -and appear after the explicitly-ordered pages at each level. -By default, all Capital letters are sorted before all lowercase letters; -adding `nav_sort: case_insensitive` in the configuration file ignores case -when sorting strings (but also sorts numbers lexicographically: `10` comes before `1`). +The parameter values determine the order of the top-level pages, and of child pages with the same parent. You can reuse the same parameter values (e.g., integers starting from 1) for the child pages of different parents. + +The parameter values can be numbers (integers, floats) and/or strings. When you omit `nav_order` parameters, they default to the titles of the pages, which are ordered alphabetically. Pages with numerical `nav_order` parameters always come before those with strings or default `nav_order` parameters. If you want to make the page order independent of the page titles, you can set explicit `nav_order` parameters on all pages. + +By default, all Capital letters come before all lowercase letters; you can add `nav_sort: case_insensitive` in the configuration file to ignore the case). Enclosing strings in quotation marks is optional. + +> *Note for users of previous versions:* `nav_sort: case_insensitive` previously affected the ordering of numerical `nav_order` parameters: e.g., `10` came before `2`. Also, all pages with explicit `nav_order` parameters previously came before all pages with default parameters. --- @@ -62,6 +63,8 @@ nav_exclude: true --- ``` +Pages with no `title` are automatically excluded from the navigation. + --- ## Pages with children