-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix TOC/breadcrumbs for multiple collections #494
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When configured for more than one collection, v0.3.2 produces empty TOCs of children in all but the last collection, due to referencing the overwritten `pages_list` in `_layouts/default.html`. When the same parent title is used in different collections, v0.3.2 can also produce a link to the wrong collection. Moreover, v0.3.3 can also produce incorrect breadcrumb links; see issue just-the-docs#492. - Move the breadcrumbs link variable assignments from `_layouts/default.html` to `_includes/nav.html`, and make it conditional on `page` being in the current collection. - Correct the condition for assignment to `second_level_url`, as in just-the-docs#477. - Change the variable used for the TOC from `children_list` to `toc_list`, move its assignment from `_layouts/default.html` to `_includes/nav.html`, and make it conditional on `page` being in the current collection. - Add regression tests for TOC/breadcrumb links in multiple collections, with configuration commented-out. With the v0.3.3 regression tests active, `diff -r -q` on `_site/docs` reports that only `_site/docs/tests/navigation/disambiguation/dca/index.html` differs, which is due to the breadcrumb correction there.
pdmosses
added a commit
to pdmosses/just-the-docs
that referenced
this pull request
Nov 20, 2020
The TOC/breadcrumb links in "Tests" and "Test Collection 1" exhibit the bug reported in just-the-docs#492. To fix the bug, this PR needs merging with just-the-docs#494.
Contributor
Author
pdmosses
added a commit
to pdmosses/just-the-docs
that referenced
this pull request
Feb 15, 2021
Manually merge the relevant changes from PR just-the-docs#494, namely: When configured for more than one collection, v0.3.2 produces empty TOCs of children in all but the last collection, due to referencing the overwritten `pages_list` in `_layouts/default.html`. When the same parent title is used in different collections, v0.3.2 can also produce a link to the wrong collection. Moreover, v0.3.3 can also produce incorrect breadcrumb links; see issue just-the-docs#492. - Move the breadcrumbs link variable assignments from `_layouts/default.html` to `_includes/nav.html`, and make it conditional on `page` being in the current collection. - Correct the condition for assignment to `second_level_url`, as in just-the-docs#477. - Change the variable used for the TOC from `children_list` to `toc_list`, move its assignment from `_layouts/default.html` to `_includes/nav.html`, and make it conditional on `page` being in the current collection.
Closed
Merged
mattxwang
added a commit
that referenced
this pull request
Jul 4, 2022
This PR combines (and resolves conflicts between) #448, #463, #466, #494, #495, #496, #498, and #572. The main aim is to facilitate use of several of the implemented features _together_, when using the fork as a remote theme. It should also simplify merging the included PRs into a future release. The branch [combination-rec-nav](https://github.com/pdmosses/just-the-docs/tree/combination-rec-nav) adds [multi-level navigation](#462) and (NEW:) [sibling links](#394) to the branch used for this PR. It includes updated [documentation for the navigation structure](https://pdmosses.github.io/just-the-docs/docs/navigation-structure/), and reorganised and extended [navigation tests](https://pdmosses.github.io/just-the-docs/tests/navigation/). The documentation and the tests can be browsed at the (temporary) [website published from the combination-rec-nav branch](https://pdmosses.github.io/just-the-docs/). _Caveat:_ The changes to v0.3.3 in this PR and #462 have not yet been reviewed or approved, and may need updating before merging into a release of the theme. If you use a branch from a PR as a remote theme, there is a risk of such updates affecting your website. Moreover, these branches are likely to be deleted after they have been merged. To avoid such problems, you could copy the branch that you want to use to your own fork of the theme. Co-authored-by: Matt Wang <[email protected]>
Member
Contributor
Author
|
As this PR was merged in a pre-release of v0.4.0, I'm deleting the PR branch. Let me know if you're still using it, and none of the pre-releases of v0.4.0 works for you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When configured for more than one collection, v0.3.2 produces empty TOCs of children in all but the last collection, due to referencing the overwritten
pages_listin_layouts/default.html. When the same parent title is used in different collections, v0.3.2 can also produce a link to the wrong collection. Moreover, v0.3.3 can also produce incorrect breadcrumb links; see issue #492.This PR makes the following changes:
Move the breadcrumbs link variable assignments from
_layouts/default.htmlto_includes/nav.html, and make it conditional onpagebeing in the current collection.Correct the condition for assignment to
second_level_url, as in Improve breadcrumb behaviour in disambiguating multiplegrand_parents #477.Change the variable used for the TOC from
children_listtotoc_list, move its assignment from_layouts/default.htmlto_includes/nav.html, and make it conditional onpagebeing in the current collection.Add regression tests for TOC/breadcrumb links in multiple collections, with configuration commented-out.
With the v0.3.3 regression tests active,
diff -r -qon_site/docsreports that only_site/docs/tests/navigation/disambiguation/dca/index.htmldiffers, which is due to the breadcrumb correction there.Fixes #492.