Repository navigation
Recolor the share card and version its URL - #58
Merged
Merged
Conversation
X, Slack and Telegram cache link previews by image URL, so a redrawn og.png at the same URL kept showing the old card. The ?v=<mtime> suffix also gets the immutable one-year cache from assets/.htaccess.
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.
Context
After #57, link previews on X, Slack and Telegram still show the old colours: the "by Psalm" pill is in the old brick red (
#a75251) and "stricter" is in the old pink (#e29a98). The image is a static PNG, so changing the CSS tokens didn't update it.Redrawing the image alone would not reach previews either.
og:imagepointed at a fixedog.pngURL, and link-preview services cache the image by URL, so a new file at the same URL keeps the old card.Solution
og.pngis redrawn with the same layout in the new colours: the pill in#c8102eand "stricter" in the dark-theme red#fd7273.og:imagenow gets the?v=<mtime>suffix that every other asset already has. A changed image gets a new URL, so previews refetch it. The versioned URL also gets the one-year immutable cache fromassets/.htaccess, where the bare URL got one day.The other card tags are unchanged:
twitter:card=summary_large_image, plusog:title,og:description,og:urlandog:image:alt.The README now opens with the same image, linked to https://shepherd.dev.