Trending Topics for Topic Landing Page #2211
Open
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.
Description
This pull request introduces a new trending topics API and related frontend components. The backend has been updated to handle caching, filtering, and returning a configurable number of trending topics based on data from google analytics. The frontend now includes a new "Trending Topics" sidebar module to display the fetched topics.
Code Changes
Django Backend:
Added a trending_topics_api endpoint that returns a filtered list of topics.
Modified the get_trending_topics helper function to accept a variable n and handle topic filtering.
Added caching decorators to the get_trending_topics function for improved performance.
Frontend:
Introduced a TrendingTopics sidebar module to display trending topics dynamically.
Added logic in sefaria.js to fetch and cache trending topics from the API.
Updated the TopicLandingPage component to include the new TrendingTopics sidebar module.
Notes
Any additional notes go here