Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/(main)/resources/[category]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export default async function CategoryPage({ params }: { params: PageParams }) {
{sections.map(key => {
const data = grouped.get(key)

// "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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

return null
}

Expand Down
Loading