Skip to content

Commit

Permalink
avoid counting projects multiple times (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt authored Dec 10, 2024
1 parent 266ef05 commit ca0b69e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _extensions/gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,13 @@ def generate_gallery_index(app, category_projects):

# Label Filter Buttons
all_labels = []
projects = set()
for sections in category_projects.values():
for section in sections:
if (project := section['path']) in projects:
continue
all_labels.extend(section['labels'])
projects.add(project)
all_labels = Counter(all_labels)
all_labels = list(all_labels.most_common())
label_buttons_html = generate_label_buttons(all_labels)
Expand Down

0 comments on commit ca0b69e

Please sign in to comment.