Feature: Display main navigation to ancestors of excluded pages #1584
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.
See discussion #1566 for motivation.
Currently (v0.10.0) the cached site-nav used in the sidebar contains links only to pages that are not excluded from the main navigation. When an excluded page is selected, the navigation path to any ancestors disappears.
This draft PR makes the cached site-nav used in the sidebar contain links to all pages, but adds the
nav-exclude
class to the HTML of links to excluded pages. The CSS for the navigation then suppresses the display of those links, and the JS scrolls the navigation to the closest non-excluded ancestor link.Preliminary testing with the Just-the-Docs-Tests repo was successful with JS enabled. The generated page-specific CSS will need adjustment to give the same navigation when JS is disabled. Rigorous testing will be needed to ensure that this should be a non-breaking change for non-customised sites.
The parameter
include.all
of several included files is now redundant, and should be removed before the code is reviewed.(The included updates to
Gemfile
andGemfile.lock
should be removed when a new version of the theme is released and this PR is updated to use it.)To experiment with using this (draft) PR, use
theme: just-the-docs
in_config.yml
and the following in yourGemfile
: