Repository navigation
Add a twitter:card tag (fix #96) - #500
Merged
Merged
Conversation
#96) Add a static og:title that Helmet replaces on each page
Collaborator
Author
|
Approved as #473 but then the merge went sideways. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One-line summary
Add
twitter:cardand a staticog:titleso links shared on X, Facebook, Slack and similar sites show a title and the existingog:imageas a large preview.Significant changes and points to review
<meta name="twitter:card" content="summary_large_image">toindex.html.og:titletoindex.html. Social crawlers don't run JavaScript, so they never see theog:titlethat Helmet adds. X falls back toog:titlewhen there is notwitter:title, so one tag covers every platform.og:titlehasdata-rh="true". react-helmet-async only replaces tags marked that way, so each page's Helmetog:titlereplaces it instead of adding a second one.og:titlein Helmet, so Helmet removes the static one there.og-title.spec.jsto check each page ends up with oneog:title(its own), including after navigation. Add ajsDisabled.spec.jscheck for the static tag.Issue / Bugzilla link
#96
Testing
Run
npm startfirst.curl -s http://localhost:3000/dashboard/hardware | grep -E 'twitter:card|og:title'and check the statictwitter:cardandog:titletags are both there.http://localhost:3000/contact, inspect<head>in devtools, and check there is exactly oneog:title, with the content "Contact | Firefox Public Data Report".