Skip to content

feat: add Twitter OG tags support and update README (#12)#13

Merged
umsungjun merged 3 commits intomainfrom
feat/add-twitter-og-support
Feb 4, 2026
Merged

feat: add Twitter OG tags support and update README (#12)#13
umsungjun merged 3 commits intomainfrom
feat/add-twitter-og-support

Conversation

@umsungjun
Copy link
Owner

@umsungjun umsungjun commented Feb 4, 2026

  • Implement auto-generation of Twitter meta tags from Open Graph data
  • Add logic to map twitter:title, twitter:description, and twitter:image
  • Update README.md with documentation for the new Twitter tag features

Summary by CodeRabbit

  • New Features

    • Twitter Card tags are now automatically generated/updated when Open Graph tags are set (title, description, image, card type).
  • Documentation

    • Added README sections, examples, and a mapping table describing Twitter Card support and Open Graph→Twitter tag mappings.
  • Tests

    • Added tests ensuring Twitter meta tags are created, kept in sync with Open Graph tags, and duplicates are prevented.
  • Chores

    • Version bumped to 1.3.0.

- Implement auto-generation of Twitter meta tags from Open Graph data
- Add logic to map twitter:title, twitter:description, and twitter:image
- Update README.md with documentation for the new Twitter tag features
@vercel
Copy link

vercel bot commented Feb 4, 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 4, 2026 1:20pm

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds Twitter Card support: when Open Graph props are set, corresponding Twitter meta tags (title, description, image, card) are generated. Documentation (English and Korean) updated; ReactHeadSafe now populates Twitter tags; tests added; package version bumped.

Changes

Cohort / File(s) Summary
Documentation
README.md, README.ko.md
Add "Twitter Card Support" section and mapping table; update features, examples, and API notes to state Twitter tags are generated automatically from Open Graph props (ogTitle→twitter:title, ogDescription→twitter:description, ogImage→twitter:image + twitter:card).
Core Implementation
src/ReactHeadSafe.tsx
Extend Open Graph tag update logic to also set twitter:title, twitter:description, twitter:image, and twitter:card (summary_large_image) when corresponding og* props are present; update comment to reflect OG + Twitter updates.
Tests
src/test/ReactHeadSafe.test.tsx
Add tests asserting Twitter meta tags (twitter:title, twitter:description, twitter:image, twitter:card) are created from og* props, duplicates are prevented, and OG+Twitter behaviors are consistent.
Manifest
package.json
Bump package version from 1.2.0 to 1.3.0 (small metadata change).

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I nibble code beneath the moon,

I plant og seeds that grow up soon,
Tweets wear petals, images gleam,
Meta carrots hop in a stream,
Hop—cards glow in morning's beam.

🚥 Pre-merge checks | ✅ 3
✅ 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 feature added: Twitter OG tags support. It clearly summarizes the primary change—adding automatic Twitter Card tag generation from Open Graph data—and the documentation updates that accompany it.
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 `@src/ReactHeadSafe.tsx`:
- Around line 47-61: Add unit tests that mirror the existing meta-tag tests but
target the auto-generated Twitter tags created by ReactHeadSafe when ogTitle,
ogDescription, and ogImage props are provided: assert that twitter:title,
twitter:description, twitter:image are created when
ogTitle/ogDescription/ogImage are set, that twitter:card is set to
"summary_large_image" when ogImage is provided, that updating
ogTitle/ogDescription/ogImage updates the corresponding twitter:* meta tags, and
that rerendering does not create duplicate twitter:* tags; reference the
ReactHeadSafe component and the ogTitle, ogDescription, ogImage prop behavior
(and updateMetaTag logic) when adding these tests and follow the same
structure/assertions used for the existing Open Graph meta tag tests.

@umsungjun umsungjun merged commit 4d02460 into main Feb 4, 2026
4 of 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