Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Dec 11, 2025

add title and meta description to layout for improved SEO

Summary by CodeRabbit

  • SEO Improvements
    • Added page title and meta description to enhance search engine visibility and improve how content appears in search results and social media previews.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codeunia Ready Ready Preview Comment Dec 11, 2025 10:27am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Walkthrough

Adds SEO metadata—page title and meta description—to the RootLayout component's head section. No changes to runtime logic or rendering flow; purely static metadata enhancement.

Changes

Cohort / File(s) Summary
SEO Metadata Enhancement
app/layout.tsx
Adds page title and meta description tags to the head of RootLayout for improved SEO on the home page.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A title so sweet, a description so fine,
SEO tags glistening in the HTML line,
The search engines dance when they see this delight,
A rabbit's small touch makes the metadata right! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding title and meta description tags to the layout component for SEO purposes, which matches the changeset summary.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/mentors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/layout.tsx (1)

24-24: Hardcoded structured data misrepresents non-home pages.

The structured data is hardcoded to 'home', but this root layout applies to all routes. Pages like /dashboard, /events, or /profile will incorrectly advertise themselves as the home page in their structured data, which can confuse search engines and harm SEO.

Solution: Move structured data generation to page-specific Server Components, similar to the metadata recommendation above:

// app/page.tsx
export const metadata = { /* ... */ }

// Add structured data per page
const structuredData = getPageStructuredData('home')

// Then inject in page component or use Next.js metadata API if it supports JSON-LD

Or if you need it in layout, derive the page type from pathname:

const pageType = pathname === '/' ? 'home' : pathname.split('/')[1] || 'home'
const structuredData = getPageStructuredData(pageType)

However, per-page Server Components with metadata exports is the cleaner, more maintainable approach.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 489a775 and c6a36af.

📒 Files selected for processing (1)
  • app/layout.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test Suite

Comment on lines +30 to +31
<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." />
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.

@codeunia-dev codeunia-dev merged commit 3d08075 into main Dec 11, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants