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: add dynamic metadata for search results #842

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

Conversation

maggienegm
Copy link
Contributor

@maggienegm maggienegm commented Dec 20, 2024

PR Checklist

Overview

This PR introduces dynamic metadata generation for the home/search page. It's metadata is now dynamically generated based on the searchParams in the URL:

{username} | Tidelift Me Up
{username} has {packageCount} npm packages eligible for Tidelift funding. 💸

This includes when a valid user has 0 packages eligible for funding based on search parameters. The metadata will look like the following:

{username} | Tidelift Me Up
{username} has 0 npm packages eligible for Tidelift funding. 💸

When no searchParams are provided, the default metadata is used, which is defined in layout.tsx:

Tidelift Me Up
Find your npm packages eligible for Tidelift funding. 💸

Also, something to note is that the API-related logic that was in page.tsx has been extracted into a separate file to improve code readability and maintainability.

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tidelift-me-up-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 1:17am

@maggienegm maggienegm force-pushed the feat-dynamic-metadata-for-search-results branch from e22c518 to 5ff089f Compare December 20, 2024 01:17
@maggienegm maggienegm marked this pull request as ready for review December 20, 2024 01:31
@@ -6,7 +6,7 @@ const raleway = Raleway({ subsets: ["latin"] });

export const metadata = {
description:
"Check if your npm packages are eligible for Tidelift funding. 💸<",
"Check if your npm packages are eligible for Tidelift funding. 💸",
Copy link
Owner

Choose a reason for hiding this comment

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

[Praise] Oh, thanks, good catch!

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.

🚀 Feature: Add SEO meta description tag for search results
2 participants