Social Previews & OpenGraph Cards¶
When a link is pasted into messaging apps or social networks (such as Slack, X, LinkedIn, iMessage, WhatsApp, Telegram, or Facebook), those platforms automatically query the URL to generate a rich visual preview card.
Customizing Preview Cards¶
Ruby allows you to customize the preview card displayed across social and messaging platforms independently of the destination page's default meta tags:
- Preview Title (
og_title): The prominent headline displayed on the card (up to 100 characters recommended). - Preview Description (
og_description): A concise summary or call to action that provides context beneath the title. - Preview Image (
og_image): A public image URL displayed as a full-width visual banner or thumbnail.
How Ruby Delivers Previews¶
Ruby's edge redirect engine automatically distinguishes between social preview crawlers and human visitors:
- Crawler Detection: When a recognized preview bot (e.g.
Twitterbot,facebookexternalhit,Slackbot-LinkExpanding,LinkedInBot) queries the link, Ruby intercepts the request and serves an HTML response containing OpenGraph (og:*) and Twitter Card (twitter:card="summary_large_image") tags. - Instant Human Redirect: When real visitors click the preview card, Ruby bypasses crawler rendering and redirects them instantly to your destination with zero interstitial latency.
- Password Protection Integration: For password-gated links, social crawlers receive safe preview information without exposing the confidential destination address.
Default Fallback Behavior
If you do not configure custom social preview metadata, Ruby allows crawlers to follow the redirect directly to your destination website, which will display its own native OpenGraph tags.
Image Formatting Best Practices¶
- Recommended Resolution: 1200 × 630 pixels (standard 1.91:1 aspect ratio). This ensures sharp, crisp rendering across high-DPI desktop screens and mobile feeds.
- Public Accessibility: The image URL must be publicly accessible via
https://without requiring authentication or cookies. - File Formats: Standard web formats (PNG, JPG, WebP) are supported across all social networks.