diff --git a/CONTRIBUTORS_FILTERING.md b/CONTRIBUTORS_FILTERING.md new file mode 100644 index 00000000000..5d8b0a27eef --- /dev/null +++ b/CONTRIBUTORS_FILTERING.md @@ -0,0 +1,142 @@ +# Contributors Page Filtering + +This document describes the filtering functionality added to the Contributors page. + +## Overview + +The Contributors page now supports dynamic filtering by project and role via URL parameters. This allows users to view specific subsets of contributors while maintaining full SEO visibility of all contributor data. + +## Usage + +### Filtering by Project + +To view contributors for a specific project, add the `project` parameter to the URL: + +``` +/contributors?project=glossary +/contributors?project=replications-and-reversals +/contributors?project=impact-on-students +``` + +Project names should be: +- Lowercase +- Spaces replaced with hyphens +- Ampersands replaced with "and" + +Examples of project name normalization: +- "Glossary" → `glossary` +- "Replications & Reversals" → `replications-and-reversals` +- "Impact on students" → `impact-on-students` + +### Filtering by Role + +To view contributors by their role, add the `role` parameter to the URL: + +``` +/contributors?role=project-manager +/contributors?role=writing---original-draft +/contributors?role=investigation +``` + +Role names follow the same normalization rules as projects. + +Examples of role name normalization: +- "Project Manager" → `project-manager` +- "Writing - original draft" → `writing---original-draft` +- "Investigation" → `investigation` + +### Combined Filtering + +You can filter by both project and role simultaneously: + +``` +/contributors?project=glossary&role=writing---review-and-editing +``` + +This will show only contributors who worked on the Glossary project with the "Writing - review & editing" role. + +### Viewing All Contributors + +To view all contributors (default view), simply visit: + +``` +/contributors +``` + +Or click the "Show All Contributors" button that appears when filters are active. + +## Technical Details + +### Data Generation (tenzing.py) + +The `tenzing.py` script has been updated to: + +1. Add a `normalize_for_attribute()` function that converts project and role names to a consistent format +2. Extract all projects and roles for each contributor +3. Generate HTML list items with `data-projects` and `data-roles` attributes +4. Wrap contributor entries in proper HTML structure with `