Quicker build (#1397)

This PR uses the cached site-nav to determine the position of each page in the navigation hierarchy. [Profiling](https://just-the-docs.github.io/just-the-docs-tests/tests/profiles/index/) shows that it significantly reduces the v0.7.0 build time for larger sites – especially with Jekyll 3. The improvement is due mainly to the elimination of loops and filters that depended on the entire site. 

For example:

- [endoflife.date](https://just-the-docs.github.io/just-the-docs-tests/tests/profiles/endoflife.date/index/) drops from 32s to 11s
- [machinetranslate.org](https://just-the-docs.github.io/just-the-docs-tests/tests/profiles/machinetranslate.org/index/) drops from 267s to ~~73s~~ 56s

### Testing

[Just the Docs Tests](https://just-the-docs.github.io/just-the-docs-tests/) is currently built using this PR branch. With JS disabled, the highlighting and unfolding of the navigation panel should be as with v0.7.0.

A diff of the tests site built with this PR branch compared to v0.7.0 should report no significant changes. For more rigorous testing, diffs of variants of the tests site should also be inspected.
This commit is contained in:
Peter Mosses
2024-02-23 06:56:52 +01:00
committed by GitHub
parent b8f6f2b75c
commit 820d256bcd
3 changed files with 269 additions and 123 deletions

View File

@@ -19,6 +19,7 @@ Code changes to `main` that are *not* in the latest release:
- Added: configurable keyboard shortcut to focus search input by [@kcromanpl-bajra] in [#1411]
- Fixed: incorrect navigation when `.html` omitted from URL by [@pdmosses] in [#1374]
- Fixed: quicker build by [@pdmosses] in [#1397]
- Fixed: incorrect positioning of clickable area for navigation links on Safari by [@mattxwang] in [#1403]
Docs changes made since the latest release:
@@ -34,6 +35,7 @@ Docs changes made since the latest release:
[#1374]: https://github.com/just-the-docs/just-the-docs/pull/1374
[#1390]: https://github.com/just-the-docs/just-the-docs/pull/1390
[#1397]: https://github.com/just-the-docs/just-the-docs/pull/1397
[#1403]: https://github.com/just-the-docs/just-the-docs/pull/1403
[#1411]: https://github.com/just-the-docs/just-the-docs/pull/1411