Skip to content

Conversation

@pdmosses
Copy link
Contributor

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 #492.

This PR makes the following changes:

  • 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 Improve breadcrumb behaviour in disambiguating multiple grand_parents #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.

Fixes #492.

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 pdmosses requested a review from pmarsceill November 20, 2020 14:20
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.
@pdmosses
Copy link
Contributor Author

Commit 6e30ec6 is in the pages-and-collections branch, used for PR #448. It adds the tests for multiple collections, but not the navigation changes implemented in the collections-nav branch used for the present PR.

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.
@pdmosses pdmosses mentioned this pull request Feb 15, 2021
@pdmosses pdmosses mentioned this pull request Feb 22, 2021
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]>
@mattxwang
Copy link
Member

Going to close as we've merged in #578; @pdmosses feel free to reopen if necessary!

@mattxwang mattxwang closed this Jul 4, 2022
@pdmosses
Copy link
Contributor Author

pdmosses commented Nov 3, 2022

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.

@pdmosses pdmosses deleted the collections-nav branch November 3, 2022 11:27
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.

TOC/breadcrumbs function incorrectly when using parent pages within collections

2 participants