Skip to content

Conversation

@umsungjun
Copy link
Owner

@umsungjun umsungjun commented Feb 5, 2026

Summary by CodeRabbit

  • New Features

    • Added Twitter Card metadata tags for improved social sharing.
    • Added Google site verification meta tag.
  • Chores

    • Added a robots.txt that allows all crawlers.

@vercel
Copy link

vercel bot commented Feb 5, 2026

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

Project Deployment Actions Updated (UTC)
react-head-safe Ready Ready Preview, Comment Feb 5, 2026 0:55am

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Added static web metadata and a crawler configuration: Twitter Card meta tags and Google site verification were inserted into the example HTML head, and a new robots.txt file allowing all user agents was added to the example public folder.

Changes

Cohort / File(s) Summary
Example HTML head
examples/basic/index.html
Inserted Twitter Card meta tags (twitter:card, twitter:title, twitter:description, twitter:image) and a google-site-verification meta tag into the document head.
Public assets / robots
examples/basic/public/robots.txt
Added robots.txt with User-agent: * and Allow: / to permit crawling of all paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I hopped into the head to weave a tiny tag,
A card for Twitter and a verification flag,
Robots greet the meadow, every path in sight,
The example shines simple, tidy, and bright!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions Twitter/OG support, but the changes include Twitter Card meta tags, Google site verification, and a robots.txt file—only partially addressing the stated objective. Revise the title to accurately reflect all changes, such as 'Add Twitter Card meta tags, Google site verification, and robots.txt' or split into focused commits with aligned titles.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-twitter-og-support

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.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

@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

🤖 Fix all issues with AI agents
In `@examples/basic/index.html`:
- Around line 22-28: The twitter:image (and corresponding og:image) meta tags
use a relative path (/logo.png) which will fail for Twitter/X and OpenGraph;
update the content attributes for the meta tags named "twitter:image" and
"og:image" to use fully-qualified absolute HTTPS URLs (including protocol and
domain), or wire them to a runtime/template variable that inserts the site's
origin so the meta values are absolute.

Comment on lines +22 to +28
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="(main) React Head Safe" />
<meta
name="twitter:description"
content="(main) A CSR-only React head manager that prevents duplicate meta tags."
/>
<meta name="twitter:image" content="/logo.png" />
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Twitter Card meta tag image URL requirements absolute vs relative path

💡 Result:

For Twitter/X Cards, the twitter:image value should be a fully-qualified (absolute) URL—i.e., include scheme + host + full path, like:

<meta name="twitter:image" content="https://example.com/images/card.jpg">

Relative paths (e.g., /images/card.jpg) commonly fail because Twitterbot can’t reliably resolve them when scraping. [2], [6]

Also avoid protocol-relative URLs (e.g., //example.com/image.jpg); use an explicit https:// URL instead. [8]

X’s card markup docs define twitter:image as a “URL of image to use in the card” and specify key constraints (e.g., supported formats, < 5MB, etc.). [3], [1]

Sources: X Developer Platform docs on Cards markup / Summary Card image constraints [3], [1]; reported behavior in practice that Twitter Cards require absolute (not relative / not protocol-relative) image URLs [2], [8].


🏁 Script executed:

# Check the full context of the HTML file
cd examples/basic && cat -n index.html | head -40

Repository: umsungjun/react-head-safe

Length of output: 1612


🏁 Script executed:

# Look for other social meta tags in the file to see URL patterns
cd examples/basic && rg 'meta name.*content' index.html -A 0

Repository: umsungjun/react-head-safe

Length of output: 403


Use absolute URLs for twitter:image and og:image.

Twitter/X Cards require fully-qualified absolute URLs for the twitter:image meta tag; relative paths like /logo.png will fail with Twitterbot and prevent card images from displaying. The same applies to og:image for consistency and OpenGraph compliance.

Required changes
-    <meta property="og:image" content="/logo.png" />
+    <meta property="og:image" content="https://react-head-safe.vercel.app/logo.png" />
     <meta property="og:url" content="https://react-head-safe.vercel.app/" />
     <meta property="og:type" content="website" />
     <meta name="twitter:card" content="summary_large_image" />
     <meta name="twitter:title" content="(main) React Head Safe" />
     <meta
       name="twitter:description"
       content="(main) A CSR-only React head manager that prevents duplicate meta tags."
     />
-    <meta name="twitter:image" content="/logo.png" />
+    <meta name="twitter:image" content="https://react-head-safe.vercel.app/logo.png" />
🤖 Prompt for AI Agents
In `@examples/basic/index.html` around lines 22 - 28, The twitter:image (and
corresponding og:image) meta tags use a relative path (/logo.png) which will
fail for Twitter/X and OpenGraph; update the content attributes for the meta
tags named "twitter:image" and "og:image" to use fully-qualified absolute HTTPS
URLs (including protocol and domain), or wire them to a runtime/template
variable that inserts the site's origin so the meta values are absolute.

@umsungjun umsungjun merged commit 278d5ba into main Feb 5, 2026
5 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.

2 participants