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

feat(blog): add search and pagination functionality #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ladunjexa
Copy link
Contributor

@ladunjexa ladunjexa commented May 6, 2024

Hi!
This commit introduces search functionality to the blog, enabling users to search for specific topics or keywords within blog posts. Additionally, pagination has been implemented to enhance user experience by breaking up long lists of posts into manageable segments. Thorough testing and coverage have been applied to ensure everything works as expected. The design methodology adheres to TailNext's design principles, and the code architecture maintains alignment with the existing structure.

The techniques used to implement this feature include Next.js searchParams and the query-string package.
Next.js useSearchParams function
query-string package

Here is a demonstration of how it works in this video:
https://www.loom.com/share/1a735796b8d7400bb4b461ffef37cdba

(I also added an API doc for the functions within the utils.ts file.)

Important

The number of posts per page can be managed via the variable POSTS_PER_PAGE, defined as a constant at line 32 within the src/utils/posts.ts file.

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.

None yet

1 participant