Skip to content

feat: enhance OpenGraph metadata for repo pages#132

Open
quemsah wants to merge 2 commits into
mainfrom
feature/og-metadata
Open

feat: enhance OpenGraph metadata for repo pages#132
quemsah wants to merge 2 commits into
mainfrom
feature/og-metadata

Conversation

@quemsah

@quemsah quemsah commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Enhance OpenGraph and Twitter metadata for repository pages
  • Add url, siteName, locale properties to OpenGraph
  • Concatenate site name to title for better social sharing

Changes

  • Add canonicalUrl generation
  • Update openGraph.type to article
  • Add openGraph.url, siteName, locale
  • Update twitter.title to include site name
  • Add alternates.canonical

Summary by CodeRabbit

  • Improvements
    • Enhanced search engine optimization: Added canonical URL support and enriched metadata (including Open Graph and Twitter details) with URL, site name, and locale for more accurate indexing.
    • Improved social media sharing: Refined social card metadata formatting and presentation to enhance how pages appear when shared.

- Add canonical URL to repo page metadata
- Add siteName to openGraph for better sharing
- Change OG type from website to article for repo pages
- Add locale to openGraph metadata
- Update Twitter card title format
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41f8ca0e-b583-40b0-a46d-475336f60516

📥 Commits

Reviewing files that changed from the base of the PR and between ae9a87f and f7b834c.

📒 Files selected for processing (1)
  • ui/src/app/[...repo]/layout.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui/src/app/[...repo]/layout.tsx

📝 Walkthrough

Walkthrough

generateMetadata in the repo route layout now imports BASE_URL to construct a canonicalUrl from the dynamic repo param. The returned metadata gains alternates.canonical, and openGraph is extended with url, siteName, and locale. The twitter title appends | Awesome Claude Plugins and the description is shortened.

Changes

SEO Metadata Enhancements

Layer / File(s) Summary
Canonical URL construction and metadata output
ui/src/app/[...repo]/layout.tsx
Imports BASE_URL, derives canonicalUrl from the joined repo route param, and updates generateMetadata to return alternates.canonical, enriched openGraph fields (url, siteName, locale, type: 'article'), and a revised twitter title with site name suffix and a shorter description.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • quemsah/awesome-claude-plugins#58: Directly modifies the same generateMetadata function in [...repo]/layout.tsx, overlapping with changes to canonical, OpenGraph, and Twitter metadata fields.

Poem

🐇 A canonical hop across the web's wide field,
With BASE_URL and repo my metadata's sealed.
OpenGraph blooms with locale and site name,
Twitter's title wears a suffix — never plain.
The rabbit signs each page with a canonical seal! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: enhance OpenGraph metadata for repo pages' clearly summarizes the main change, which is improving OpenGraph and Twitter metadata for repository pages.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/og-metadata

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/src/app/`[...repo]/layout.tsx:
- Line 11: The canonicalUrl variable is using encodeURIComponent on the entire
repoName, which encodes forward slashes as %2F and breaks the URL structure. To
fix this, split repoName by forward slashes, apply encodeURIComponent to each
individual path segment separately, and then rejoin them with forward slashes
before constructing the canonicalUrl. This will preserve the path hierarchy
while properly encoding special characters within each segment.
- Line 37: The OpenGraph type property in the repository page layout is
incorrectly set to 'article', but it should be 'website' to align with other
similar informational pages in the codebase. The 'article' type is semantically
incorrect for repository pages as it requires metadata properties like
article:published_time and article:author that are not applicable here. Change
the type value from 'article' to 'website' in the OpenGraph metadata
configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ce2a74cd-654e-4ee6-be2c-04f980e7f7a8

📥 Commits

Reviewing files that changed from the base of the PR and between 11833c7 and ae9a87f.

📒 Files selected for processing (1)
  • ui/src/app/[...repo]/layout.tsx

Comment thread ui/src/app/[...repo]/layout.tsx Outdated
title: `${repoName}`,
description: `Explore ${repoName} repository with Claude Code plugins, MCP servers, and agent skills. View plugin adoption metrics, AI development tools, and automated workflow integrations`,
type: 'website',
type: 'article',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if other Next.js projects use 'article' type for repository/profile pages

rg -n "type:\s*['\"]article['\"]" --type ts --type tsx -A5 -B5

Repository: quemsah/awesome-claude-plugins

Length of output: 102


🌐 Web query:

OpenGraph protocol article type requirements and recommended properties

💡 Result:

To implement the Open Graph article type, you must first include the four core properties required for all Open Graph objects [1][2]. These are: og:title: The title of your article. og:type: Set to "article". og:image: A URL to an image representing the article. og:url: The canonical URL of the article, acting as its permanent ID. In addition to these base properties, you should include the article-specific metadata using the article namespace (article:*) to provide detailed context to scrapers and social platforms [1][3][2]. Recommended Article-Specific Properties These properties, while optional, are highly recommended for better representation [1][2]: article:published_time: The datetime when the article was first published [1][2]. article:modified_time: The datetime when the article was last changed [1][2]. article:expiration_time: The datetime when the article should be considered out of date [1][2]. article:author: An array of URLs to profile objects for the writers of the article [1][2]. article:section: A string representing the high-level section of the site (e.g., "Technology") [1][2]. article:tag: An array of tags associated with the article [1][2]. Additional Metadata Depending on your platform's integration (particularly if targeting Facebook's news indexing), you may also use these properties [4]: article:opinion: A boolean (true/false) indicating if the content is an opinion piece [4]. article:content_tier: Defines access status (e.g., "free", "locked", or "metered") [4]. article:location: Allows geo-tagging the content (e.g., city or region) [4]. Implementation Best Practices Always validate your markup using tools like the Facebook Sharing Debugger or similar platform-specific inspectors to ensure the properties are correctly parsed [3]. Because the Open Graph protocol uses RDFa, these tags should be placed within the head section of your HTML [1][2]. Note that once an object (a URL) has been shared and has accumulated significant engagement (like likes or shares), some properties, such as the object type, may become locked by the platform and impossible to change [5].

Citations:


🏁 Script executed:

cat -n ui/src/app/\[...repo\]/layout.tsx | sed -n '20,50p'

Repository: quemsah/awesome-claude-plugins

Length of output: 1170


🏁 Script executed:

# Check if there are any article metadata properties being set elsewhere in the codebase
rg -n "article:" ui/src --type ts

# Also check what type values are used elsewhere
rg -n "type:\s*['\"]" ui/src -A2 -B2

Repository: quemsah/awesome-claude-plugins

Length of output: 5236


Change OpenGraph type from article to website for repository pages.

Repository pages are directory/informational content similar to the stats and about pages, which both use type: 'website'. The article type is semantically incorrect here—it requires metadata properties like article:published_time, article:author, and article:section per the OpenGraph specification, none of which are provided or applicable to repository pages.

Align this with the rest of the codebase by using website instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/src/app/`[...repo]/layout.tsx at line 37, The OpenGraph type property in
the repository page layout is incorrectly set to 'article', but it should be
'website' to align with other similar informational pages in the codebase. The
'article' type is semantically incorrect for repository pages as it requires
metadata properties like article:published_time and article:author that are not
applicable here. Change the type value from 'article' to 'website' in the
OpenGraph metadata configuration.

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.

1 participant