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: Implementing Next.js Metadata API for better SEO and Web Shareability #1932

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,34 @@ export const metadata: Metadata = {
default: "ProjectsHut - Learn. Build. Share.",
template: '%s - ProjectsHut',
},
description:
"A platform where you can share your open source projects with the world.",
description: "A platform where you can share your open source projects with the world.",
keywords: ["ProjectHut", "projects", "educational resources","wide range of products", "high-quality projects", "React", "Nodejs", "JavaScript", "open source", "contribution", "learners"],
authors: {name: "Priyankar Pal"},
openGraph: {
title: 'ProjectsHut - Learn. Build. Share.',
description: 'A platform where you can share your open source projects with the world.',
url: 'https://projectshut.vercel.app',
siteName: 'ProjectHut',
locale: 'en-US',
type: 'website',
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
twitter: {
title: 'ProjectsHut - Learn. Build. Share.',
card: 'summary_large_image',
description: "A platform where you can share your open source projects with the world.",
images: "https://user-images.githubusercontent.com/88102392/251507361-e71396f9-92c6-4664-b7e4-4275cb902e65.png"
},
};

export default function RootLayout({
Expand All @@ -23,30 +49,6 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<head>
<meta name="title" content={metadata.description as string} />
<meta
name="description"
content={metadata.description as string}
/>
<meta name="language" content="en" />
<meta name="keywords" content="ProjectHut, projects, educational resources, wide range of projects, high-quality projects, React, Nodejs , javascript, open source, contribution , learners" />
<meta name="author" content="Priyankar Pal" />
<meta name="robots" content="index, follow" />
<meta name="revisit-after" content="7 days" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{/* Open Graph meta tags for website preview */}
<meta property="og:title" content={metadata.title as string} />
<meta property="og:description" content={metadata.description as string} />
<meta property="og:url" content="https://projectshut.vercel.app/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="ProjectHut" />
{/* Twitter meta tags for website preview */}
<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:title" content={metadata.title as string} />
<meta property="twitter:description" content={metadata.description as string} />
<meta property="twitter:image" content="https://user-images.githubusercontent.com/88102392/251507361-e71396f9-92c6-4664-b7e4-4275cb902e65.png" />
</head>
<body className={inter.className} suppressHydrationWarning={true}>
<Navbar />

Expand Down