Skip to content

Upgrade to Tocbot 4.35.3 and simplify setup #4067

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

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

mudge
Copy link
Contributor

@mudge mudge commented Apr 2, 2025

Previously, the "On this page" table of contents would contain a server-side rendered table of contents generated by the Jekyll AsciiDoc plugin but this was always set to be hidden (even to screen readers). We would then replace this element with the client-side rendered table of contents generated by Tocbot. The latter is only visible on screens wider than 1460px so there is no need for us to have logic to refresh the Tocbot whenever the window is resized under 768px (as it will be hidden anyway).

@mudge mudge force-pushed the upgrade-and-simplify-tocbot branch from 203c3e4 to 07d0220 Compare April 2, 2025 13:52
Previously, the "On this page" table of contents would contain a
server-side rendered table of contents generated by the Jekyll AsciiDoc
plugin but this was always set to be hidden (even to screen readers). We
would then replace this element with the client-side rendered table of
contents generated by Tocbot. The latter is only visible on screens
wider than 1460px so there is no need for us to have logic to refresh
the Tocbot whenever the window is resized under 768px (as it will be
hidden anyway).
@mudge mudge force-pushed the upgrade-and-simplify-tocbot branch from 07d0220 to 8d67ea9 Compare April 2, 2025 14:01
@lurch
Copy link
Contributor

lurch commented Apr 2, 2025

For bears with little brains: is the TLDR here that there's now less processing being done by the client-side javascript?

@mudge
Copy link
Contributor Author

mudge commented Apr 2, 2025

There are two savings here:

  1. We no longer serve a server-side rendered but always hidden version of the "On this page" table of contents
  2. We no longer refresh the "On this page" table of contents on every resize of the browser window

@lurch
Copy link
Contributor

lurch commented Apr 2, 2025

When you say "server-side rendered" do you mean "build-time created"? I thought the output of the docs toolchain was just static HTML, without any server-side processing being done? (or have things changed since the last time I looked at them?)

@mudge
Copy link
Contributor Author

mudge commented Apr 2, 2025

When you say "server-side rendered" do you mean "build-time created"?

Yes: here the "server" doing the rendering of static HTML is the GitHub Actions runner.

@mudge mudge merged commit af4581b into develop Apr 2, 2025
1 check passed
@mudge mudge deleted the upgrade-and-simplify-tocbot branch April 2, 2025 15:03
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.

3 participants