Skip to content

Commit 96b48b5

Browse files
committed
Emit only categories actually used by a package into its version manifest
1 parent d072c24 commit 96b48b5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

scripts/lib/notebooks.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,16 @@ def generate_version_manifest(
404404
key=lambda n: (category_order.get(n["category"], 99), n["title"])
405405
)
406406

407+
# Only emit categories that this package actually uses. The full CATEGORIES
408+
# list was previously dumped into every manifest — typically 8 out of 9
409+
# categories were empty per package, bloating manifests and confusing the
410+
# frontend TOC.
411+
used_category_ids = {n["category"] for n in sorted_notebooks}
412+
used_categories = [c for c in CATEGORIES if c["id"] in used_category_ids]
413+
407414
return {
408415
"package": package_id,
409416
"tag": tag,
410417
"notebooks": sorted_notebooks,
411-
"categories": CATEGORIES,
418+
"categories": used_categories,
412419
}

0 commit comments

Comments
 (0)