Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure pages with nav_exclude are ignored by navigation #407

Closed
wants to merge 2 commits into from

Conversation

pdmosses
Copy link
Contributor

Pages with nav_exclude: true are currently sorted on title and nav_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 no title are never displayed in the navigation, so removing them from pages_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 of 404.html has been changed to the number 404, the page docs/untitled-test.md has been added, and nav_sort_order has been set to case_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.

Pages with `nav_exclude: true` were included when sorting on `title` or `nav_order`. That could cause build failures when the type of value of the field differs from that on other pages, as reported in just-the-docs#406.

Pages with `nav_exclude: true` or no `title` are never displayed in the navigation, so removing them from `pages_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 of `404.html` has been changed to the number `404`,  the page `docs/untitled-test.md`  has been added, and `nav_sort_order` has been set to `case_sensitive`. Those updates give build failures with the current version of `_includes/nav.html`, 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,.
404.html Show resolved Hide resolved
docs/untitled-test.md Outdated Show resolved Hide resolved
@pmarsceill pmarsceill changed the base branch from master to v0.3.2 August 10, 2020 15:32
@pdmosses pdmosses mentioned this pull request Aug 13, 2020
@pdmosses
Copy link
Contributor Author

This is fixed by #411.

@pdmosses pdmosses closed this Sep 11, 2020
@pdmosses pdmosses deleted the nav-exclusion branch September 29, 2020 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants