Repository navigation
Conversation
Exclude docs sections from the empty resource-group check, since their content comes from category configuration.
|
@6iu8a is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel. A member of the Team first needs to authorize it. |
| // "event" section uses working group meetings, not resources | ||
| if (key !== "event" && !data?.length) { | ||
| // event and docs use independent data sources, not grouped resources | ||
| if (key !== "event" && key !== "docs" && !data?.length) { |
There was a problem hiding this comment.
This looks like it might be a band-aid -- @6iu8a I'm not too familiar with this section of the site, do you have any idea what the underlying problem might be? Should we be altering the sections list instead?
There was a problem hiding this comment.
Thanks for taking a look! The underlying issue is that docs gets its content from a different source than the one this guard checks. sections already includes docs from categoriesConfig, and DocsSection resolves the configured doc paths through learnPages. Those pages aren't loaded into grouped, so the empty-resource check skips the section even though it has content.
I kept this change small to fix that mismatch, following the existing exception for event. Your suggestion about sections makes sense, though: we could determine which sections to display based on their respective data sources, then use that same list for both the TOC and rendering. Currently, the TOC uses the unfiltered list while the rendering loop can skip sections.
Would you prefer that I update this PR in that direction?
Exclude docs sections from the empty resource-group check, since their content comes from category configuration.
Closes #2533
Description
Documentation sections were skipped when a category had no resources
grouped under
docs, even though their content is defined independentlyin
categoriesConfig.Exclude
docsfrom the empty resource-group check, alongsideevent.This restores the configured documentation sections and their navigation
targets on the frontend, backend, federation, security, and monitoring pages.