From 85d1fbb20dd5a50ca4c0771d29bc5425dea9a803 Mon Sep 17 00:00:00 2001 From: AmirReza Jamali Date: Wed, 17 Jun 2026 13:51:49 +0330 Subject: [PATCH] Fix Lighthouse SEO metadata issues --- app/(home)/layout.tsx | 9 ++--- app/(home)/page.tsx | 4 +-- app/(not-found)/[...not-found]/layout.tsx | 10 ++++-- app/_components/NavigationBar.tsx | 2 +- app/global-not-found.tsx | 40 +++++++++++++++++++++++ app/robots.ts | 13 ++++++++ app/sitemap.ts | 26 +++++++++++++++ contact-us.html | 4 ++- email-marketing.html | 4 ++- index.html | 4 ++- next.config.ts | 5 ++- 11 files changed, 106 insertions(+), 15 deletions(-) create mode 100644 app/global-not-found.tsx create mode 100644 app/robots.ts create mode 100644 app/sitemap.ts diff --git a/app/(home)/layout.tsx b/app/(home)/layout.tsx index 046a467..22184a3 100644 --- a/app/(home)/layout.tsx +++ b/app/(home)/layout.tsx @@ -1,6 +1,5 @@ import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; -import { headers } from "next/headers"; import Image from "next/image"; import Link from "next/link"; import { Suspense } from "react"; @@ -19,7 +18,7 @@ const geistMono = Geist_Mono({ }); export const metadata: Metadata = { - metadataBase: new URL("https://opplens.com"), + metadataBase: new URL("https://opplenz.com"), title: "Opp lens - AI-Powered Tender Management", description: "Democratizing Tender Access for SMEs with AI-Powered Tender Management.", @@ -81,13 +80,11 @@ function ContactInfo({ ); } -export default async function RootLayout({ +export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { - const domain = (await headers()).get("host")?.replace("www.", ""); - const contactInfo = [ { icon: "/Message.svg", @@ -128,7 +125,7 @@ export default async function RootLayout({ - + diff --git a/app/(home)/page.tsx b/app/(home)/page.tsx index 629000b..c22b9a7 100644 --- a/app/(home)/page.tsx +++ b/app/(home)/page.tsx @@ -11,7 +11,7 @@ export const metadata: Metadata = { openGraph: { title: "Opp lens - AI-Powered Tender Management", description: "Win more tenders automatically with our AI-powered platform", - url: "https://opplens.com/", + url: "https://opplenz.com/", type: "website", locale: "en_US", siteName: "Opp lens", @@ -23,7 +23,7 @@ export const metadata: Metadata = { images: ["/images/opp-lens-mobile.jpg"], }, alternates: { - canonical: "https://opplens.com/", + canonical: "https://opplenz.com/", }, robots: { index: true, diff --git a/app/(not-found)/[...not-found]/layout.tsx b/app/(not-found)/[...not-found]/layout.tsx index 2be2a2f..df7e340 100644 --- a/app/(not-found)/[...not-found]/layout.tsx +++ b/app/(not-found)/[...not-found]/layout.tsx @@ -18,8 +18,14 @@ const geistMono = Geist_Mono({ }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + metadataBase: new URL("https://opplenz.com"), + title: "Page Not Found | Opp lens", + description: + "Opp lens helps SMEs find relevant tenders, automate document handling, and get real-time alerts for new opportunities.", + robots: { + index: false, + follow: true, + }, icons: { icon: "/fav-icon.svg", }, diff --git a/app/_components/NavigationBar.tsx b/app/_components/NavigationBar.tsx index 39bb34f..50e8fc6 100644 --- a/app/_components/NavigationBar.tsx +++ b/app/_components/NavigationBar.tsx @@ -2,7 +2,7 @@ import Link from "next/link"; import { usePathname } from "next/navigation"; -const NavigationBar = ({ host }: { host: string }) => { +const NavigationBar = ({ host = "opplenz.com" }: { host?: string }) => { const pathname = usePathname(); return ( diff --git a/app/global-not-found.tsx b/app/global-not-found.tsx new file mode 100644 index 0000000..b3e66c0 --- /dev/null +++ b/app/global-not-found.tsx @@ -0,0 +1,40 @@ +import "./globals.css"; + +const description = + "Opp lens helps SMEs find relevant tenders, automate document handling, and get real-time alerts for new opportunities."; + +export default function GlobalNotFound() { + return ( + + + Page Not Found | Opp lens + + + + + +
+

Page not found

+

+ Sorry, the page you are looking for does not exist or has been + removed. +

+ + Home + +
+ + + ); +} diff --git a/app/robots.ts b/app/robots.ts new file mode 100644 index 0000000..30be888 --- /dev/null +++ b/app/robots.ts @@ -0,0 +1,13 @@ +import type { MetadataRoute } from "next"; + +const siteUrl = "https://opplenz.com"; + +export default function robots(): MetadataRoute.Robots { + return { + rules: { + userAgent: "*", + allow: "/", + }, + sitemap: `${siteUrl}/sitemap.xml`, + }; +} diff --git a/app/sitemap.ts b/app/sitemap.ts new file mode 100644 index 0000000..dfec2a7 --- /dev/null +++ b/app/sitemap.ts @@ -0,0 +1,26 @@ +import type { MetadataRoute } from "next"; + +const siteUrl = "https://opplenz.com"; + +export default function sitemap(): MetadataRoute.Sitemap { + return [ + { + url: siteUrl, + lastModified: new Date(), + changeFrequency: "weekly", + priority: 1, + }, + { + url: `${siteUrl}/contact-us`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.7, + }, + { + url: `${siteUrl}/marketing`, + lastModified: new Date(), + changeFrequency: "monthly", + priority: 0.6, + }, + ]; +} diff --git a/contact-us.html b/contact-us.html index 88f4f07..dd5c4bf 100644 --- a/contact-us.html +++ b/contact-us.html @@ -4,6 +4,8 @@ + + Opplens @@ -156,4 +158,4 @@ - \ No newline at end of file + diff --git a/email-marketing.html b/email-marketing.html index e087542..a6ed02b 100644 --- a/email-marketing.html +++ b/email-marketing.html @@ -4,6 +4,8 @@ + + Opplens @@ -258,4 +260,4 @@ - \ No newline at end of file + diff --git a/index.html b/index.html index cf95696..5fb3b92 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,8 @@ + + Opplens @@ -151,4 +153,4 @@ - \ No newline at end of file + diff --git a/next.config.ts b/next.config.ts index e9ffa30..ad273f1 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,10 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + experimental: { + globalNotFound: true, + }, + htmlLimitedBots: /.*/, }; export default nextConfig;