Skip to content

Commit

Permalink
feat: implementing nextjs metadata api (#1932)
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar Saini <[email protected]>
  • Loading branch information
s2sharpit authored Aug 2, 2023
1 parent 1f9e38a commit cbe130b
Showing 1 changed file with 28 additions and 26 deletions.
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

0 comments on commit cbe130b

Please sign in to comment.