Skip to content

feat: add OpenGraph Link Preview Support#5478

Open
fmartingr wants to merge 2 commits intousememos:mainfrom
fmartingr:feat/og-support
Open

feat: add OpenGraph Link Preview Support#5478
fmartingr wants to merge 2 commits intousememos:mainfrom
fmartingr:feat/og-support

Conversation

@fmartingr
Copy link

Overview

This PR adds OpenGraph link preview functionality to Memos. When enabled, external HTTP/HTTPS links in memos will display rich preview cards showing the page title, description, and preview image - similar to what you see on Twitter, LinkedIn, and other modern platforms.

Features

  • Card-style link previews with image, title, description, and domain name
  • Server-side caching (7-day TTL) to minimize external API requests
  • Client-side caching via React Query for optimal performance
  • Instance-level setting to enable/disable the feature
  • URL normalization for consistent caching across different URL formats
CleanShot 2026-01-12 at 17 12 25@2x

How It Works

  1. When viewing a memo, the frontend extracts all HTTP/HTTPS URLs from the markdown content
  2. If link previews are enabled, it fetches OpenGraph metadata for each URL via the new API endpoint
  3. Preview cards are displayed below the memo content with the fetched metadata
  4. Responses are cached on both server and client to avoid redundant requests

Configuration

Enable the feature in Settings → Memo Related Settings → "Enable OpenGraph link previews".

@fmartingr fmartingr changed the title feat; add OpenGraph Link Preview Support feat: add OpenGraph Link Preview Support Jan 12, 2026
@boojack boojack force-pushed the main branch 2 times, most recently from a196c72 to 71e8a06 Compare February 10, 2026 01:15
@boojack boojack self-requested a review as a code owner February 24, 2026 14:23
@boojack boojack force-pushed the main branch 2 times, most recently from 2b6b987 to 47d9414 Compare February 24, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant