Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default function RootLayout({
return (
<html lang="en" suppressHydrationWarning>
<head>
<title>Codeunia | Bridge the gap between campus and career</title>
<meta name="description" content="Codeunia is a community platform connecting students with hackathons, events, internships, and career opportunities. Bridge the gap between campus and career." />
Comment on lines +30 to +31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Hardcoded metadata in root layout affects ALL pages.

The title and meta description are static in the root layout, which means every page in the app (dashboard, profile, events, etc.) will have identical metadata. This is detrimental to SEO because:

  1. Search engines penalize duplicate titles/descriptions across pages
  2. Each page should have unique, contextual metadata
  3. Browser tabs cannot distinguish between pages
  4. The pathname-specific content won't be reflected in search results

Recommended approach:

In Next.js 15 App Router, metadata should be defined per page/layout using the metadata export or generateMetadata function in Server Components. Since this root layout needs to be a Client Component (for usePathname()), consider:

  1. Remove these tags from root layout and define metadata in each page's Server Component:
// app/page.tsx (home page)
export const metadata = {
  title: 'Codeunia | Bridge the gap between campus and career',
  description: 'Codeunia is a community platform connecting students...'
}
  1. Or use a hybrid approach: Keep root layout as Server Component and move pathname-dependent logic elsewhere, or use template/layout files per route segment.

  2. Per-page metadata examples:

    • /dashboard → "Dashboard | Codeunia"
    • /events → "Upcoming Events | Codeunia"
    • /profile → "Your Profile | Codeunia"

This ensures each route has unique, SEO-optimized metadata.

🤖 Prompt for AI Agents
In app/layout.tsx around lines 30-31 the root layout currently contains
hardcoded <title> and <meta description> which forces identical metadata across
all pages; remove these tags from the root layout and instead define metadata
per route using Next.js App Router (export const metadata or export async
function generateMetadata in each page or layout server component) — if you need
pathname-dependent logic, either convert the root to a Server Component and move
client-only usePathname() into a child Client Component, or create per-segment
layout/template files so each route can export its own metadata (e.g.,
dashboard, events, profile) to ensure unique, SEO-friendly titles and
descriptions.

{/* Critical CSS for above-the-fold content */}
<style dangerouslySetInnerHTML={{
__html: `
Expand Down
Loading