feat(meta): add the Open Graph preview image - #460
Merged
Merged
Conversation
Move the exported social card to app/opengraph-image.png so Next.js emits og:image and twitter:image as absolute kn0.app URLs with size and alt text, and point the brand export command at the new path.
Merged
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.
Description
This finishes the in-repo part of #451. #456 added the Open Graph and Twitter metadata but had no image to point at. #458 then added the social card artwork. This PR connects the two, so a kn0.app link unfurls with the large card.
app/opengraph-image.png: the #458 social card (1200×630, 86 KB), moved here frompublic/brand/social-card.pngusing Next's static-file convention. It was moved rather than copied so there's only one copy of the exported PNG.app/opengraph-image.alt.txt: the alt text for the card. The file has no trailing newline on purpose: Next reads it verbatim, so a newline would end up inside thecontentattribute.public/brand/README.md: thesocial-card.svgrow now says where its export lives, the separatesocial-card.pngrow is gone, and the export command writes the card toapp/opengraph-image.png. I re-ran the command: both PNGs came out byte for byte identical to the committed files.No
twitter-image.png. Next copies the Open Graph image into the Twitter tags on its own, so X getstwitter:imagewithout a second file.Verification
npm run build, then inout/index.html:og:title,og:description,og:url,twitter:cardandtheme-colorare still there from #456.out/opengraph-image.pngis exported, and the query string on its URL is a content hash that changes whenever the image does, so re-exporting the card also busts crawler caches.Spell-check, lint, type-check and build all pass.
format:checkpasses once line endings are ignored; locally it only fails on the Windows CRLF checkout. There's no visible UI change, so there are no screenshots, and no radio behavior is involved.Theme color: #446 hasn't added the per-scheme
theme-colorentries yet, so the page still has only the plain#4f8ef7entry from #456, and that's the one Discord reads. Once #446 lands, the comment onviewport.themeColorinapp/layout.tsxcovers keeping that entry first.After merge (can't be done from the repo)
https://kn0.app/?v=2into Discord and check the title, description, large card and blue side bar.public/brand/repo-social.pngunder Settings → General → Social preview (there's no API for it), then check that a repo link pasted into Discord shows the card.Issues
Type of Change
!-- Breaking change (fix or feature that would cause existingfunctionality to change)
feat-- New feature (non-breaking change which adds functionality)fix-- Bug fix (non-breaking change which fixes an issue)docs-- Additional or updated documentationstyle-- Code style changes (formatting, missing semi colons, etc)refactor-- Code refactorperf-- Performance improvementtest-- Tests (adding or updating tests)build-- Build system or external dependencies changesci-- Build configuration changechore-- Grunt tasksrevert-- Revert previous changes