-
-
Notifications
You must be signed in to change notification settings - Fork 42
Improved User Profile SEO with Meta Tags #105
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,33 @@ | ||
| import React from "react"; | ||
| import { Metadata } from "next"; | ||
| import { getProfileData } from "@/lib/api"; | ||
|
|
||
| export async function generateMetadata({ | ||
| params, | ||
| }: { | ||
| params: Promise<{ username: string }>; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type for params: { username: string }; |
||
| }): Promise<Metadata> { | ||
| const { username } = await params; | ||
| const user = await getProfileData(username); | ||
| return { | ||
| title: user | ||
| ? user.seo.title | ||
| : `Devb.io - Build Stunning Developer Portfolios in Minutes`, | ||
| description: user | ||
| ? user.seo.description | ||
| : `Passionate developer skilled in modern technologies, building and learning through real-world projects and daily challenges.`, | ||
| keywords: user | ||
| ? user.seo.keywords | ||
| : "Developer Portfolio, Devb.io, Software Engineer, Projects, Resume, GitHub Showcase", | ||
NayanUnni95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| openGraph: { | ||
| images: user?.avatar_url, | ||
| }, | ||
| twitter: { | ||
| images: user?.avatar_url, | ||
| }, | ||
| }; | ||
| } | ||
| const Layout = ({ children }: { children: React.ReactNode }) => { | ||
| return <>{children}</>; | ||
| }; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.