Skip to content

Commit 62c8a2d

Browse files
authored
Merge pull request #78 from BeyteFlow/copilot/add-seo-meta-descriptions
SEO & Bing compliance: fix title duplication, canonical URLs, IndexNow, heading hierarchy, and internal linking
2 parents 07c4086 + 8513662 commit 62c8a2d

File tree

11 files changed

+105
-22
lines changed

11 files changed

+105
-22
lines changed

next-sitemap.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
generateRobotsTxt: true,
66
changefreq: "weekly",
77
priority: 0.7,
8-
additionalPaths: async (config) => [
8+
additionalPaths: async () => [
99
{
1010
loc: "/",
1111
changefreq: "weekly",

src/app/api/indexnow/route.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { NextResponse } from "next/server";
2+
3+
const SITE_URL =
4+
process.env.SITE_URL ||
5+
process.env.NEXT_PUBLIC_SITE_URL ||
6+
"https://readmegen-ai.vercel.app";
7+
8+
// IndexNow key matches the file in /public/85f2c293fce3483d896a5d9dc98974e5.txt
9+
const INDEXNOW_KEY = "85f2c293fce3483d896a5d9dc98974e5";
10+
11+
const URLS_TO_INDEX = [
12+
`${SITE_URL}/`,
13+
`${SITE_URL}/features`,
14+
`${SITE_URL}/examples`,
15+
`${SITE_URL}/docs`,
16+
`${SITE_URL}/generate`,
17+
];
18+
19+
/**
20+
* POST /api/indexnow
21+
* Notifies Bing IndexNow of updated URLs for timely crawling and indexing.
22+
* Call this endpoint after deploying significant content changes.
23+
*/
24+
export async function POST() {
25+
const host = new URL(SITE_URL).hostname;
26+
27+
const payload = {
28+
host,
29+
key: INDEXNOW_KEY,
30+
keyLocation: `${SITE_URL}/${INDEXNOW_KEY}.txt`,
31+
urlList: URLS_TO_INDEX,
32+
};
33+
34+
try {
35+
const response = await fetch("https://api.indexnow.org/indexnow", {
36+
method: "POST",
37+
headers: { "Content-Type": "application/json; charset=utf-8" },
38+
body: JSON.stringify(payload),
39+
});
40+
41+
if (response.ok || response.status === 202) {
42+
return NextResponse.json(
43+
{ success: true, submitted: URLS_TO_INDEX.length },
44+
{ status: 200 },
45+
);
46+
}
47+
48+
return NextResponse.json(
49+
{ success: false, status: response.status },
50+
{ status: 502 },
51+
);
52+
} catch (error) {
53+
console.error("IndexNow submission failed:", error);
54+
return NextResponse.json(
55+
{ success: false, error: "Network error during IndexNow submission" },
56+
{ status: 502 },
57+
);
58+
}
59+
}

src/app/docs/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ import { FAQ } from "@/components/docs/FAQ";
77
import { navLinks } from "@/constants/navLinks";
88

99
export const metadata: Metadata = {
10-
title: "Documentation | ReadmeGenAI",
10+
title: { absolute: "Documentation | ReadmeGenAI" },
1111
description:
1212
"Learn how to use ReadmeGenAI, the AI README generator for GitHub. Quick-start guides, API docs, FAQs, and tips for perfect GitHub README files.",
13+
alternates: {
14+
canonical: "/docs",
15+
},
1316
openGraph: {
1417
title: "Documentation | ReadmeGenAI",
1518
description:

src/app/examples/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import type { Metadata } from "next";
22
import ExamplesClient from "./ExamplesClient";
33

44
export const metadata: Metadata = {
5-
title: "Examples | ReadmeGenAI",
5+
title: { absolute: "Examples | ReadmeGenAI" },
66
description:
77
"Browse real GitHub README examples generated by ReadmeGenAI. See AI README output for Next.js apps, TypeScript libraries, Go backends, and more.",
8+
alternates: {
9+
canonical: "/examples",
10+
},
811
openGraph: {
912
title: "Examples | ReadmeGenAI",
1013
description:

src/app/features/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ import { Cpu, Globe, ShieldCheck, Sparkles, Zap, Code2 } from "lucide-react";
66
import { navLinks } from "@/constants/navLinks";
77

88
export const metadata: Metadata = {
9-
title: "Features | ReadmeGenAI",
9+
title: { absolute: "Features | ReadmeGenAI" },
1010
description:
1111
"Discover ReadmeGenAI features: AI README generator powered by Gemini, GitHub Octokit integration, instant generation, and framework-aware documentation.",
12+
alternates: {
13+
canonical: "/features",
14+
},
1215
openGraph: {
1316
title: "Features | ReadmeGenAI",
1417
description:

src/app/generate/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import type { Metadata } from "next";
22
import GeneratePageClient from "./GeneratePageClient";
33

44
export const metadata: Metadata = {
5-
title: "Generate README | ReadmeGenAI",
5+
title: { absolute: "Generate README | ReadmeGenAI" },
66
description:
77
"Paste any GitHub repository URL and instantly generate a polished, professional README with ReadmeGenAI — the free AI README generator for developers.",
8+
alternates: {
9+
canonical: "/generate",
10+
},
811
openGraph: {
912
title: "Generate README | ReadmeGenAI",
1013
description:

src/app/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ export const metadata: Metadata = {
3636
siteName: "ReadmeGenAI",
3737
images: [
3838
{
39-
url: "/og-image.png",
39+
url: "/ReadmeGenAI.png",
4040
width: 1200,
4141
height: 630,
42-
alt: "ReadmeGenAI - AI README Generator",
42+
alt: "ReadmeGenAI - AI README Generator for GitHub Projects",
4343
},
4444
],
4545
locale: "en_US",
@@ -50,7 +50,7 @@ export const metadata: Metadata = {
5050
title: "Generate README Files with AI",
5151
description:
5252
"Paste your GitHub repository URL and get a professional readme.md instantly.",
53-
images: ["/og-image.png"],
53+
images: ["/ReadmeGenAI.png"],
5454
},
5555
robots: {
5656
index: true,

src/app/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ import { Code, Layout, FileText } from "lucide-react";
99
import { navLinks } from "@/constants/navLinks";
1010

1111
export const metadata: Metadata = {
12-
title: "AI README Generator for GitHub Projects | ReadmeGenAI",
12+
title: {
13+
absolute: "AI README Generator for GitHub Projects | ReadmeGenAI",
14+
},
1315
description:
1416
"Instantly create professional GitHub README files with ReadmeGenAI. Our AI README generator analyzes your repo and produces polished markdown docs in seconds.",
17+
alternates: {
18+
canonical: "/",
19+
},
1520
openGraph: {
1621
title: "AI README Generator for GitHub Projects | ReadmeGenAI",
1722
description:

src/components/layout/Footer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export const Footer = () => (
1616

1717
<div className="flex gap-6 items-center">
1818
<a
19-
href="#"
19+
href="https://github.com/BeyteFlow/ReadmeGenAI"
20+
target="_blank"
21+
rel="noopener noreferrer"
2022
aria-label="GitHub"
2123
className="text-zinc-500 hover:text-white transition-colors"
2224
>

src/components/layout/Navbar.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22
import React, { useState, useEffect } from "react";
3+
import Link from "next/link";
34
import { Menu, X, Github } from "lucide-react";
45
import { Button } from "../ui/Button";
56

@@ -28,14 +29,18 @@ export const Navbar = ({
2829
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
2930
<div className="flex justify-between items-center">
3031
{/* Brand Logo */}
31-
<div className="flex items-center gap-3 group cursor-pointer">
32+
<Link
33+
href="/"
34+
className="flex items-center gap-3 group cursor-pointer"
35+
aria-label="ReadmeGenAI Home"
36+
>
3237
<div className="relative w-9 h-9 bg-white rounded-lg flex items-center justify-center overflow-hidden transition-transform group-hover:rotate-3">
3338
<span className="text-black font-black text-xl">R</span>
3439
</div>
3540
<span className="font-bold text-xl tracking-tighter">
3641
ReadmeGenAI
3742
</span>
38-
</div>
43+
</Link>
3944

4045
{/* Desktop Menu */}
4146
<div className="hidden md:flex items-center space-x-1">

0 commit comments

Comments
 (0)