Repository navigation
feat(head): a post's share video (og:video), with the share image kept - #6
Merged
Merged
Conversation
A post can carry ogVideo, a looping MP4 the size of its share image. Its
page then gets og:video, og:video:secure_url, og:video:type and the size,
and og:type video.other, which Discord needs to play it; iMessage plays it
too. The share image, twitter:image and summary_large_image all stay, and
the video goes out only with a share image, since every other app shows
that instead.
LinkedIn shows no image for a page with og:video, so LinkedInBot gets the
post without the video tags and as an article (public.ts). The preview
host moves the video's address with the image's, and a media move rewrites
it like the other image columns.
Schema v13 adds posts.og_video. Set it through the admin API
(PUT admin/api/posts/:id with {"ogVideo": "https://..."}).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
A post can now have a share video (
ogVideo): a looping MP4 that link previews play in iMessage and Discord.When a post has one, its page gets:
og:video,og:video:secure_url,og:video:type(video/mp4), andog:video:width/og:video:height(the share image's size)og:typeset tovideo.other, which Discord needs before it plays the videoThe share image stays
og:image, its size and alt text,twitter:imageandtwitter:card=summary_large_imageare all still written. Every app that doesn't play video shows the image.og:video. So forLinkedInBot,serveSiteremoves theog:video*tags and setsog:typeback toarticle. This happens on the response, so the cached page is unchanged.I checked
headTagsand the strip with Bun's HTMLRewriter for three cases:Data
ALTER TABLE posts ADD COLUMN og_video TEXT. Posts only; pages don't take a video.toPost,POST_FIELDS, the list query and the snapshot columns. You set it withPUT admin/api/posts/:id {"ogVideo": "https://..."}.rewriteUrlsmoves it along with the other media columns.og:image.bun run typecheckand the leak guard (with the denylist) pass.🤖 Generated with Claude Code