Skip to content

docs: add dynamic og#7135

Closed
Barbapapazes wants to merge 8 commits intorolldown:mainfrom
Barbapapazes:docs/add-dynamic-og
Closed

docs: add dynamic og#7135
Barbapapazes wants to merge 8 commits intorolldown:mainfrom
Barbapapazes:docs/add-dynamic-og

Conversation

@Barbapapazes
Copy link
Contributor

@Barbapapazes Barbapapazes commented Nov 20, 2025

Hello 👋,

I recently shared a link on X and I saw that the OG wasn't related to the page. So it doesn't make you want to click.

To fix this, OG images are dynamically generated based on the page title. The homepage keeps the current OG images. If needed, I can change the template. I tried to have something related to the current one. Let me know!

builtin-plugins-esm-external-require apis-plugin-api development-guide-setup-the-project

Copilot AI review requested due to automatic review settings November 20, 2025 00:17
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 20, 2025

How to use the Graphite Merge Queue

Add the label graphite: merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds dynamic Open Graph (OG) image generation for documentation pages using the sharp library. The implementation automatically generates unique OG images for each markdown page based on the page title.

Key Changes:

  • Added sharp package (v0.34.5) for image processing
  • Created an SVG template for OG images with dynamic title placeholders
  • Implemented automatic OG image generation during build using VitePress's transformPageData hook
  • Added generated OG images directory to .gitignore

Reviewed Changes

Copilot reviewed 2 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pnpm-lock.yaml Added sharp@0.34.5 dependency and its platform-specific binaries; removed libc fields from various package entries
docs/package.json Added sharp as a dev dependency
docs/.vitepress/og-template.svg New SVG template for OG images with placeholders for dynamic title lines
docs/.vitepress/config.ts Implemented addImage and genOg functions to generate OG images for each page; added transformPageData hook to process pages
.gitignore Added docs/public/og to ignore generated OG images
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 20, 2025 00:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 5 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 20, 2025 12:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings November 20, 2025 12:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Barbapapazes
Copy link
Contributor Author

I'm now using a plugin, based on this tweet from Evan You.

@mdong1909
Copy link
Collaborator

Wow this is really cool. Just a heads up that we're doing a rebranding that should be released in the next few weeks. The SVG logo will need to be updated then.

Are we able to customize the font?

@TheAlexLichter
Copy link
Collaborator

@mdong1909 This should be possible through a custom og image template

@Barbapapazes
Copy link
Contributor Author

Barbapapazes commented Nov 21, 2025

Yes, font can be customized.

I'm using Figma to create and edit the SVG. I will add a dedicated section in the plugin documentation.

If needed, I can help create the new OG based on the upcoming rebranding.

Copilot AI mentioned this pull request Feb 3, 2026
7 tasks
@graphite-app graphite-app bot closed this in 17c5798 Feb 3, 2026
@shulaoda shulaoda reopened this Feb 3, 2026
@shulaoda shulaoda closed this Feb 3, 2026
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.

5 participants