diff --git a/src/app/generate/[repo]/page.tsx b/src/app/generate/[repo]/page.tsx index 28edc96..e388230 100644 --- a/src/app/generate/[repo]/page.tsx +++ b/src/app/generate/[repo]/page.tsx @@ -2,9 +2,9 @@ import type { Metadata } from "next"; import GeneratePageClient from "@/app/generate/GeneratePageClient"; interface PageProps { - params: { + params: Promise<{ repo: string; // e.g., "facebook/react" - }; + }>; } // Dynamic Metadata for SEO and social sharing @@ -21,7 +21,7 @@ export async function generateMetadata({ openGraph: { title: `README for ${repoDisplayName} | ReadmeGenAI`, description: `Generate a polished README.md for ${repoName} using ReadmeGenAI.`, - url: `https://readmegen-ai.vercel.app/generate/${repoName}`, + url: `/generate/${repoName}`, siteName: "ReadmeGenAI", images: [ { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index c291958..8c75cfc 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -31,7 +31,7 @@ export const metadata: Metadata = { title: "ReadmeGenAI – AI GitHub README Generator", description: "Automatically generate professional README files from your GitHub repositories using AI.", - url: "https://readmegen-ai.vercel.app", + url: "/", siteName: "ReadmeGenAI", images: [ { @@ -62,6 +62,9 @@ export default function RootLayout({ }: Readonly<{ children: React.ReactNode; }>) { + const siteUrl = + process.env.NEXT_PUBLIC_SITE_URL || "https://readmegen-ai.vercel.app"; + return ( @@ -77,7 +80,7 @@ export default function RootLayout({ operatingSystem: "Web", description: "AI-powered GitHub README generator that creates markdown documentation automatically.", - url: "https://readmegen-ai.vercel.app", + url: siteUrl, }), }} /> diff --git a/src/components/Generator/SearchInput.tsx b/src/components/Generator/SearchInput.tsx index 4ab474e..1f6d1fe 100644 --- a/src/components/Generator/SearchInput.tsx +++ b/src/components/Generator/SearchInput.tsx @@ -7,12 +7,14 @@ interface SearchInputProps { onGenerate: (url: string) => void; isLoading: boolean; initialValue?: string; // optional initial value + ariaLabel?: string; // optional aria-label for accessibility } export const SearchInput = ({ onGenerate, isLoading, initialValue, + ariaLabel, }: SearchInputProps) => { // Initialize state directly from initialValue once const [url, setUrl] = useState(initialValue || ""); @@ -46,6 +48,7 @@ export const SearchInput = ({ if (error) setError(null); }} placeholder="https://github.com/username/repo" + aria-label={ariaLabel} className={`w-full bg-zinc-900/50 border ${ error ? "border-red-500/50" : "border-white/10" } rounded-2xl py-6 pl-14 pr-40 text-white placeholder:text-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all backdrop-blur-xl`}