Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced category filtering #1507

Closed

Conversation

idanidan29
Copy link
Contributor

What kind of change does this PR introduce?

Feature – This PR allows blog posts to belong to multiple categories instead of just one. and improve the filtering to filter more than one category

Issue Number:

Screenshots/videos:

image
*I added the category to the blog only for the example picture and did not actually change the blog category.

Summary

  • The blog data structure is updated to support an array of categories.
  • The UI now renders each category as a separate clickable badge.
  • Users can filter by multiple categories at once.
  • Filtering logic has been improved to sort posts by the number of matching categories when multiple filters are selected.

Blog posts now support multiple categories by framing them like this in the blog file:

type:
  - Case Study
  - Engineering

This enhancement improves content organization, filtering functionality, and provides greater flexibility for authors.

Does this PR introduce a breaking change?
no

@idanidan29 idanidan29 requested a review from a team as a code owner March 11, 2025 14:00
Copy link

github-actions bot commented Mar 11, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview d705f6c

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (219521e) to head (d705f6c).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1507   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          396       396           
  Branches       106       106           
=========================================
  Hits           396       396           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@DhairyaMajmudar DhairyaMajmudar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@idanidan29 pls. resolve the merge conflicts from your PR.

@@ -1,3 +1,4 @@
/* eslint-disable indent */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't bypass eslint by disable comments

@@ -46,6 +49,7 @@ export async function getStaticProps({ query }: { query: any }) {

await generateRssFeed(blogPosts);

// Filtering based on query parameter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comments

@idanidan29 idanidan29 closed this Mar 18, 2025
@idanidan29 idanidan29 force-pushed the Enhanced-category-filtering branch from d705f6c to ea04243 Compare March 18, 2025 07:11
@idanidan29 idanidan29 reopened this Mar 18, 2025
@idanidan29
Copy link
Contributor Author

Thanks for the feedback, @DhairyaMajmudar! I'm having a hard time resolving the conflicts, and the codebase on the branch is a bit outdated. I'll keep working on this in a new branch and open a new PR with your adjustments once it's done

@idanidan29 idanidan29 closed this Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Enhancement: Allow blogs to have multiple categories and enable filtering by multiple categories
2 participants