diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..0065ae6 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,32 @@ +# robots.txt — Citronics 2026 (cdgicitronics.in) +# Generated for optimal Google / Bing / Edge crawling + +User-agent: * +Allow: / +Allow: /about +Allow: /events +Allow: /events/ +Allow: /gallery +Allow: /team +Allow: /register + +# Exclude auth, transactional, and private pages from indexation +Disallow: /login +Disallow: /dashboard +Disallow: /tickets +Disallow: /api/ +Disallow: /401 +Disallow: /404 +Disallow: /500 + +# Next.js internals — allow render-critical JS/CSS but block image optimizer +Disallow: /_next/ +Allow: /_next/static/ +Disallow: /_next/image + +# Exclude admin routes +Disallow: /admin +Disallow: /admin/ + +# Sitemap location +Sitemap: https://cdgicitronics.in/sitemap.xml diff --git a/src/components/SEO/SEOHead.js b/src/components/SEO/SEOHead.js new file mode 100644 index 0000000..41754dc --- /dev/null +++ b/src/components/SEO/SEOHead.js @@ -0,0 +1,91 @@ +/** + * ┌──────────────────────────────────────────────────────────────────────────┐ + * │ SEOHead — Core Component │ + * │ │ + * │ Renders title, meta description, keywords, canonical URL, Open Graph, │ + * │ Twitter Card, and JSON-LD structured data. │ + * │ │ + * │ NOT imported directly in pages — wrapped by per-page components like │ + * │ HomeSEO, AboutSEO, etc. that pre-fill all props. │ + * └──────────────────────────────────────────────────────────────────────────┘ + */ +import Head from 'next/head' +import { SITE, buildCanonical } from './seo.config' + +const SEOHead = ({ + title, + description, + keywords, + canonicalPath = '/', + ogType = 'website', + ogImage, + noIndex = false, + schemas = [], +}) => { + const pageTitle = title || SITE.name + const pageDescription = description || `${SITE.name} — ${SITE.tagline}.` + const canonical = buildCanonical(canonicalPath) + + // Ensure OG image is absolute + const rawOgImage = ogImage || SITE.ogImage + const absoluteOgImage = rawOgImage.startsWith('http') + ? rawOgImage + : `${SITE.url}${rawOgImage.startsWith('/') ? rawOgImage : `/${rawOgImage}`}` + + return ( + + {/* ── Title ──────────────────────────────────────────── */} + {pageTitle} + + {/* ── Core meta — what crawlers and AI models read first */} + + {keywords && } + + + + + {/* ── Canonical URL ──────────────────────────────────── */} + + + {/* ── Open Graph (Facebook, WhatsApp, iMessage, etc.) ── */} + + + + + + + + + + + + + {/* ── Twitter Card ─────────────────────────────────────── */} + + + + + + + + + {/* ── AI / LLM discoverability hints ───────────────────── */} + + + + + + + {/* ── JSON-LD Structured Data ───────────────────────────── */} + {schemas.map((schema, i) => ( +