Ensure pages with nav_exclude are ignored by navigation #407
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pages with
nav_exclude: true
are currently sorted ontitle
andnav_order
. That can cause build failures when the type of value of the field differs from that on other pages, as reported in #406.Pages with
nav_exclude: true
or notitle
are never displayed in the navigation, so removing them frompages_list
cannot break existing sites. This change also allows the removal of some tests in the code. (The indentation of the code should now be adjusted, but that has been deferred, to restrict the size of the diff for review.)For testing, the
title
of404.html
has been changed to the number404
, the pagedocs/untitled-test.md
has been added, andnav_sort_order
has been set tocase_sensitive
. Those updates give build failures with release 0.3.1, but not after the suggested changes.It will still be possible for build failures to occur due to sorting fields of non-excluded pages with differing types of values (e.g.,
nav_order
a mixture of numbers and strings). To make the code completely safe will require relatively complicated changes.