Add social preview image and page titles - #569
Open
vipulpandey21 wants to merge 1 commit into
Open
Conversation
Any podman.io link shared on Slack or X unfurls without a picture. themeConfig never set `image`, so og:image is missing on every page, even though Docusaurus writes twitter:card=summary_large_image everywhere. The site asks for the big card layout and leaves it empty. The four custom pages also all show up as "Podman" with no description, because they render a bare <Layout>. The card reuses what the site already has: the gray-900 to purple-900 gradient from the testimonial section, Montserrat, and the dark logo variant. Descriptions come from copy already in static/data. The homepage keeps its title so it doesn't render "Podman | Podman". Signed-off-by: Vipul Subhash Pandey <vipulpandey7917@gmail.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 I found
I was checking what podman.io sends to crawlers and noticed no page sets
og:image. I checked the live site directly:Same result on
/get-started,/features,/community,/docs/installationand/blogs. So any link to podman.io shared on Slack, X, LinkedIn, Discord or Mastodon unfurls with no picture.The part that made me look closer is that Docusaurus already writes this on every page:
That asks the platform for the large image layout, but there is no image to put in it. The site is requesting the frame and not supplying anything to fill it.
themeConfigindocusaurus.config.jshas noimagekey, andgit log -S "image:" -- docusaurus.config.jscomes back empty, so it looks like it was never set rather than removed at some point.While confirming that I also noticed the four custom pages all render the same title:
They all call a bare
<Layout>, so there is no per-page title and no description either. Docs and blog pages do get a description because Docusaurus derives one from the content, but the four main pages get nothing.What this changes
themeConfig.imagenow points at a card, which givesog:imageandtwitter:imageon every page. I also addedtitleanddescriptionto the four custom pages.For the card I stayed with things already in the repo rather than introducing anything new:
TestimonialSection/index.tsx:17displayfont intailwind.config.jsstatic/logos/raw/podman-logo-dark.png, the variant meant for dark backgroundsstatic/data/home.ts:4I first tried the brand purple background but the purple "pod" in the wordmark disappeared into it, which is why the darker gradient is there.
That image is a mockup I generated to show the difference side by side. It is not a screenshot from any particular platform, and the "before" panel is text only because that is what platforms fall back to when there is no
og:image.The descriptions are taken from copy already in the repo (
home.ts,features.ts,community.ts) rather than written from scratch. The homepage keeps its current title and only gains a description, otherwise it renders as "Podman | Podman".Checks
yarn buildpasses. In the build output:Titles now come out as
Get Started | Podman,Features | Podman,Community | Podman, homepage stillPodman.yarn typecheckreports only the pre-existingget-started.tsx:102error, which is #537 and not touched here.The card is 1200x630 and 82 KB.
Notes
og:imageis absolute and resolves to podman.io. Happy to check it against a validator after merge.robots.txtreturns 404 whilesitemap.xmlis fine. Different concern so I left it out, but I can open a separate issue if that is useful.