Skip to content

Commit 192b2e5

Browse files
committed
feat: add SEO support with robots and sitemap generation
- Implemented robots.ts to define crawling rules and sitemap URL. - Created sitemap.ts to list key public pages for search engines. - Updated scoring methodology page to use new SEO components and structured data. - Added JsonLd component for structured data representation. - Refactored scoring methodology page to separate client-side logic. - Enhanced app header with a link to the home page. - Improved compare form with additional header information. - Created home-page-client component for better state management and user experience. - Added tests for SEO helpers and routes to ensure proper functionality. - Updated localization files for new strings related to the changes. - Added Open Graph image for better social media sharing.
1 parent 5eb24e5 commit 192b2e5

16 files changed

Lines changed: 905 additions & 515 deletions

File tree

app/layout.tsx

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import "./globals.css";
22
import type { ReactNode } from "react";
3+
import type { Metadata } from "next";
34
import { cookies, headers } from "next/headers";
45
import Script from "next/script";
56
import {
@@ -10,6 +11,7 @@ import {
1011
parseAcceptLanguage,
1112
supportedLocales,
1213
} from "@/lib/i18n-core";
14+
import { getMetadataBase, toAbsoluteUrl } from "@/lib/seo";
1315
import Providers from "./providers";
1416

1517
const themeInitScript = `
@@ -30,9 +32,64 @@ const themeInitScript = `
3032
} catch {}
3133
`;
3234

33-
export const metadata = {
34-
title: "DevImpact",
35-
description: "GitHub user scoring",
35+
export const metadata: Metadata = {
36+
title: {
37+
default: "DevImpact | GitHub Developer Comparison & Open-Source Impact Scoring",
38+
template: "%s | DevImpact",
39+
},
40+
description:
41+
"Compare GitHub developers by repository impact, merged external pull requests, and community contribution signals with transparent scoring.",
42+
keywords: [
43+
"github developer comparison",
44+
"open source impact score",
45+
"github repository analytics",
46+
"pull request impact",
47+
"developer ranking tool",
48+
"devimpact",
49+
],
50+
authors: [{ name: "DevImpact Team" }],
51+
creator: "DevImpact",
52+
publisher: "DevImpact",
53+
metadataBase: getMetadataBase(),
54+
alternates: {
55+
canonical: "/",
56+
},
57+
openGraph: {
58+
type: "website",
59+
title: "DevImpact | GitHub Developer Comparison & Open-Source Impact Scoring",
60+
description:
61+
"Compare GitHub developers with transparent repo, PR, and community contribution scoring.",
62+
url: "/",
63+
siteName: "DevImpact",
64+
images: [
65+
{
66+
url: toAbsoluteUrl("/og-image.svg"),
67+
width: 1200,
68+
height: 630,
69+
alt: "DevImpact GitHub developer comparison dashboard preview",
70+
},
71+
],
72+
},
73+
twitter: {
74+
card: "summary_large_image",
75+
title: "DevImpact | GitHub Developer Comparison",
76+
description:
77+
"Compare open-source impact using repository, pull request, and community contribution signals.",
78+
images: [toAbsoluteUrl("/og-image.svg")],
79+
},
80+
robots: {
81+
index: true,
82+
follow: true,
83+
nocache: false,
84+
googleBot: {
85+
index: true,
86+
follow: true,
87+
"max-image-preview": "large",
88+
"max-snippet": -1,
89+
"max-video-preview": -1,
90+
},
91+
},
92+
manifest: "/manifest.webmanifest",
3693
icons: {
3794
icon: "/logo.svg",
3895
shortcut: "/logo.svg",

app/manifest.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { MetadataRoute } from "next";
2+
import { SITE_NAME, SITE_SHORT_NAME } from "@/lib/seo";
3+
4+
export default function manifest(): MetadataRoute.Manifest {
5+
return {
6+
name: SITE_NAME,
7+
short_name: SITE_SHORT_NAME,
8+
description:
9+
"Compare GitHub developers with transparent open-source impact scoring.",
10+
start_url: "/",
11+
display: "standalone",
12+
background_color: "#ffffff",
13+
theme_color: "#0ea5e9",
14+
icons: [
15+
{
16+
src: "/logo.svg",
17+
sizes: "any",
18+
type: "image/svg+xml",
19+
},
20+
],
21+
};
22+
}

0 commit comments

Comments
 (0)