Hide topics with 2 or fewer sources from A-Z, category browse, and Google [sc-45176]#3496
Open
nsantacruz wants to merge 2 commits into
Open
Hide topics with 2 or fewer sources from A-Z, category browse, and Google [sc-45176]#3496nsantacruz wants to merge 2 commits into
nsantacruz wants to merge 2 commits into
Conversation
…oogle search [sc-45176] Topics with 2 or fewer sources are no longer surfaced on the Topic A-Z page, category/TOC browse cards, or Google (excluded from the sitemap and marked noindex on their own page). They remain fully intact in the database and still appear in other topics' "Related Topics" sidebars. should_display() gains an optional min_sources param (default preserves existing behavior) so the stricter threshold can be applied only at the three affected call sites, leaving the sidebar's annotate_topic_link() path untouched. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
📊 Code Quality Score: 16/100
Was this score accurate? 👍 Yes · 👎 No Scored by GitVelocity · How are scores calculated? |
Collapses four repetitive test methods into a single pytest.mark.parametrize covering the same cases (default vs raised threshold, curation exemptions, explicit shouldDisplay=False override). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
topics-sitemap.xmland markednoindexon their own page).annotate_topic_link) is untouched.data_source == "sefaria"still displays.Topic.should_display()gains an optionalmin_sourcesparam (default1, preserving prior behavior everywhere it isn't explicitly overridden); the stricter threshold (MIN_SOURCES_FOR_TOPIC_DISPLAY = 3) is applied only at the three affected call sites:get_all_topics()(A-Z page),get_topic_toc_json_recursive()(category browse), andgenerate_topics_sitemap().shouldDisplayfield.Test plan
pytest sefaria/model/tests/topic_test.py sefaria/helper/tests/topic_test.py— 33 passed, including new coverage for the threshold, the curation exemption, andget_all_topics(min_sources=...)reader/tests/social_image_api_test.py(ALLOWED_HOSTS/hostname handling) are present onmastertoo, viagit stash/topics/all/<letter>and its category page, still renders directly at/topics/<slug>with<meta name="robots" content="noindex, nofollow">, still appears in a linked topic's sidebar, and is absent fromtopics-sitemap.xml🤖 Generated with Claude Code