Repository navigation
fix: render long reference sidebars once instead of on every page - #413
Merged
Merged
Conversation
📚 Preview this PR's docs locallyFetch the just-built site and open it in your browser: # this exact build
great-docs preview --run 39994553024
# or always the latest build for this PR
great-docs preview --pr 413Auth & tips
|
has2k1
approved these changes
Oct 23, 2026
has2k1
left a comment
Collaborator
There was a problem hiding this comment.
LTGM.
Though I am surprised there is no related issue at quarto-cli.
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
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.
Quarto rebuilds a page's whole sidebar on every page that shows it. On a large API this takes much of the render time: for a large API's reference sidebar it could list about 1,500 links, and every reference page has to render it. This PR has Quarto render each long reference sidebar once and then copies it into the pages that show it.
Before rendering, each reference sidebar (
reference,cli-reference,mcp-reference) is copied to a fullgd-full-<id>sidebar. Only a one-page template shows that copy, and the original sidebar keeps just the links the navbar needs, so Quarto renders a short sidebar on each page. After rendering, a post-render script (share-sidebars.py) takes the full sidebar from the template and puts it into each page. It marks the page's link as current, opens the sections around it, restores the search crumbs Quarto takes from the sidebar, and removes the template from the site and sitemap.Pages aren't edited: the sidebar is named through the directory's
_metadata.yml, so freeze caches stay valid. Normal builds run this just before rendering, and versioned builds run it in each version's directory.The output matches a plain Quarto render: every page is byte-identical, and the search index holds the same entries. On a 303-page site with a 300-link reference sidebar,
quarto renderwent from 241 to 145s (about 40% faster). Larger sidebars should save more. Sites with short sidebars (such as this one, with 14, 32 and 24 links) render in about the same time as before. A full versioned build of the Great Docs site succeeded, with the full sidebar and the right current link on the API, CLI and MCP pages in every version.