Skip to content

feat: Generate per-course metadata in courses/[courseId] instead of s… - #1120

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
OkeQueen:issue_926
Jul 30, 2026
Merged

feat: Generate per-course metadata in courses/[courseId] instead of s…#1120
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
OkeQueen:issue_926

Conversation

@OkeQueen

Copy link
Copy Markdown
Contributor

Generate per-course metadata in courses/[courseId]
Summary

Fixes #926

generateMetadata in courses/[courseId]/page.tsx was missing a per-course Open Graph image and canonical URL (title/description were already dynamic from an earlier commit).
Adds alternates.canonical and openGraph.url pointing to /courses/${courseId}, resolved against the existing metadataBase in src/app/layout.tsx.
Adds openGraph.images and twitter.images sourced from course.thumbnailUrl, omitted when a course has no thumbnail.
Changes
src/app/courses/[courseId]/page.tsx

return {
title: ${course.title} | TeachLink,
description: course.description,

  • alternates: {
  •  canonical: `/courses/${courseId}`,
    
  • },
    openGraph: {
    title: ${course.title} | TeachLink,
    description: course.description,
    type: 'website',
    siteName: 'TeachLink',
  •  url: `/courses/${courseId}`,
    
  •  images: course.thumbnailUrl
    
  •    ? [{ url: course.thumbnailUrl, alt: course.title }]
    
  •    : undefined,
    
    },
    twitter: {
    card: 'summary_large_image',
    site: '@TeachLink',
    title: ${course.title} | TeachLink,
    description: course.description,
  •  images: course.thumbnailUrl ? [course.thumbnailUrl] : undefined,
    
    },
    };
    Test plan
    npm install then npx tsc --noEmit (not run here — node_modules not installed in this environment)
    npm run dev, visit /courses/ for a course with and without thumbnailUrl, inspect for og:image, og:url, and
    Confirm Course Not Found case still returns the generic fallback metadata

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@OkeQueen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 29df132 into rinafcode:main Jul 30, 2026
6 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.

Generate per-course metadata in courses/[courseId] instead of static SEO

2 participants