Skip to content

docs: add dynamic OG image generation#8179

Merged
graphite-app[bot] merged 1 commit intomainfrom
copilot/rebase-vitepress-plugin-og
Feb 3, 2026
Merged

docs: add dynamic OG image generation#8179
graphite-app[bot] merged 1 commit intomainfrom
copilot/rebase-vitepress-plugin-og

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Summary

This PR rebases #7135 on top of the main branch and adds dynamic OG (Open Graph) image generation for documentation pages.

close #7135

Changes Made

  • Add vitepress-plugin-og@^0.0.5 to pnpm-workspace.yaml catalog
  • Update docs/package.json to include vitepress-plugin-og as devDependency
  • Update docs/.vitepress/config.ts to integrate OG image generation:
    • Import addOgImage from vitepress-plugin-og
    • Convert transformPageData to async function
    • Generate dynamic OG images for all pages except homepage
    • Configure domain as https://rolldown.rs with maxTitleSizePerLine: 16
  • Create docs/.vitepress/og-template.svg matching current Rolldown theme:
    • Dark background (#1C1D1F) consistent with docs theme
    • Rolldown branding with gradient text (#EEBD43 to #FC781F)
    • Dynamic placeholders for {{line1}} and {{line2}} (page titles)
    • Fixed: Embedded Rolldown logo as proper SVG vector graphics (not broken base64 PNG)
    • Updated: Use the actual "ROLLDOWN" text path from logo instead of plain text
  • Add docs/public/og to .gitignore for generated OG images
  • Update pnpm-lock.yaml with new dependency
  • Verify plugin loads correctly and configuration is valid

What This Enables

  • Each documentation page now has a unique OG image generated from its title
  • Improved social media sharing with relevant preview images per page
  • Homepage retains its existing static OG image (og.jpg)
  • Subdirectory index pages (e.g., builtin-plugins/index.md) get dynamic OG images
  • Rolldown logo is now visible in the generated OG images
  • "Rolldown" branding uses the stylized logo text with arrow icon

Technical Notes

  • Uses relativePath !== 'index.md' to exclude only the root homepage
  • The check correctly allows OG images for subdirectory index files
  • Logo is embedded as SVG elements with proper filters and masks
  • Bottom "Rolldown" text now uses the actual path from rolldown-dark.svg logo, including the stylized letters and arrow icon
  • Plugin has peer dependency warning (expects vitepress@^1.6.4, we use 2.0.0-alpha.15) but works correctly
  • Existing docs build issues (dead links, missing reference docs) are unrelated to these changes
Original prompt

Rebase #7135 on top of main branch and update the vitepress-plugin-og package to latest and update docs/.vitepress/og-template.svg to match the latest docs theme


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 17c5798
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69821a5ed407080008d0d5d1

Copilot AI changed the title [WIP] Rebase pull request 7135 and update vitepress plugin Add dynamic OG image generation for docs pages Feb 3, 2026
Copilot AI requested a review from sapphi-red February 3, 2026 03:49
Copilot AI requested a review from sapphi-red February 3, 2026 06:37
@sapphi-red sapphi-red changed the title Add dynamic OG image generation for docs pages docs: add dynamic OG image generation for docs pages Feb 3, 2026
@sapphi-red sapphi-red changed the title docs: add dynamic OG image generation for docs pages docs: add dynamic OG image generation Feb 3, 2026
@sapphi-red sapphi-red marked this pull request as ready for review February 3, 2026 06:48
Copilot AI review requested due to automatic review settings February 3, 2026 06:48
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

Adds dynamic Open Graph (OG) image generation for VitePress documentation pages, so shared links render page-specific preview images rather than a single static image.

Changes:

  • Adds vitepress-plugin-og@^0.0.5 to the pnpm catalog/lockfile and wires it into docs devDependencies.
  • Integrates addOgImage into docs/.vitepress/config.ts via an async transformPageData hook (excluding the root index.md).
  • Adds an OG SVG template and ignores generated OG artifacts under docs/public/og.

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Adds vitepress-plugin-og to the workspace catalog.
pnpm-lock.yaml Locks vitepress-plugin-og (and its deps like sharp).
docs/package.json Adds vitepress-plugin-og as a docs devDependency.
docs/.vitepress/config.ts Generates OG images during page transform via addOgImage.
docs/.vitepress/og-template.svg Adds a custom SVG template for generated OG images.
.gitignore Ignores generated OG output in docs/public/og.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@sapphi-red sapphi-red requested review from TheAlexLichter and removed request for sapphi-red February 3, 2026 09:33
Copy link
Member

hyf0 commented Feb 3, 2026

Merge activity

## Summary
This PR rebases #7135 on top of the main branch and adds dynamic OG (Open Graph) image generation for documentation pages.

close #7135

## Changes Made
- [x] Add vitepress-plugin-og@^0.0.5 to pnpm-workspace.yaml catalog
- [x] Update docs/package.json to include vitepress-plugin-og as devDependency
- [x] Update docs/.vitepress/config.ts to integrate OG image generation:
  - Import `addOgImage` from `vitepress-plugin-og`
  - Convert `transformPageData` to async function
  - Generate dynamic OG images for all pages except homepage
  - Configure domain as `https://rolldown.rs` with `maxTitleSizePerLine: 16`
- [x] Create docs/.vitepress/og-template.svg matching current Rolldown theme:
  - Dark background (#1C1D1F) consistent with docs theme
  - Rolldown branding with gradient text (#EEBD43 to #FC781F)
  - Dynamic placeholders for {{line1}} and {{line2}} (page titles)
  - **Fixed: Embedded Rolldown logo as proper SVG vector graphics (not broken base64 PNG)**
  - **Updated: Use the actual "ROLLDOWN" text path from logo instead of plain text**
- [x] Add docs/public/og to .gitignore for generated OG images
- [x] Update pnpm-lock.yaml with new dependency
- [x] Verify plugin loads correctly and configuration is valid

## What This Enables
- Each documentation page now has a unique OG image generated from its title
- Improved social media sharing with relevant preview images per page
- Homepage retains its existing static OG image (og.jpg)
- Subdirectory index pages (e.g., builtin-plugins/index.md) get dynamic OG images
- **Rolldown logo is now visible in the generated OG images**
- **"Rolldown" branding uses the stylized logo text with arrow icon**

## Technical Notes
- Uses `relativePath !== 'index.md'` to exclude only the root homepage
- The check correctly allows OG images for subdirectory index files
- Logo is embedded as SVG elements with proper filters and masks
- Bottom "Rolldown" text now uses the actual path from rolldown-dark.svg logo, including the stylized letters and arrow icon
- Plugin has peer dependency warning (expects vitepress@^1.6.4, we use 2.0.0-alpha.15) but works correctly
- Existing docs build issues (dead links, missing reference docs) are unrelated to these changes

<!-- START COPILOT CODING AGENT SUFFIX -->

<!-- START COPILOT ORIGINAL PROMPT -->

<details>

<summary>Original prompt</summary>

> Rebase #7135 on top of main branch and update the `vitepress-plugin-og` package to latest and update `docs/.vitepress/og-template.svg` to match the latest docs theme

</details>

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/rolldown/rolldown/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
@graphite-app graphite-app bot force-pushed the copilot/rebase-vitepress-plugin-og branch from 6fd0910 to 17c5798 Compare February 3, 2026 15:55
@graphite-app graphite-app bot merged commit 17c5798 into main Feb 3, 2026
32 checks passed
@graphite-app graphite-app bot deleted the copilot/rebase-vitepress-plugin-og branch February 3, 2026 16:08
@github-actions github-actions bot mentioned this pull request Feb 4, 2026
shulaoda pushed a commit that referenced this pull request Feb 4, 2026
Merging by graphite seems to ignore the authors in each commits. This PR is to test whether the co-author comment in the PR message works and add the co-authors in #8179 properly.

Co-authored-by: barbapapazes <e.soubiran25@gmail.com>
graphite-app bot pushed a commit that referenced this pull request Feb 4, 2026
Retry of #8191, as it wasn't merged with the merge queue.

---

Merging by graphite seems to ignore the authors in each commits. This PR is to test whether the co-author comment in the PR message works and add the co-authors in #8179 properly.

Co-authored-by: barbapapazes [e.soubiran25@gmail.com](mailto:e.soubiran25@gmail.com)
shulaoda added a commit that referenced this pull request Feb 4, 2026
Retry of #8191, as it wasn't merged with the merge queue.

---

Merging by graphite seems to ignore the authors in each commits. This PR is to test whether the co-author comment in the PR message works and add the co-authors in #8179 properly.

Co-authored-by: barbapapazes <e.soubiran25@gmail.com>
graphite-app bot pushed a commit that referenced this pull request Feb 4, 2026
Retry of #8191, as it wasn't merged with the merge queue.

---

Merging by graphite seems to ignore the authors in each commits. This PR is to test whether the co-author comment in the PR message works and add the co-authors in #8179 properly.

Co-authored-by: barbapapazes <e.soubiran25@gmail.com>
@github-actions github-actions bot mentioned this pull request Feb 4, 2026
shulaoda added a commit that referenced this pull request Feb 4, 2026
## [1.0.0-rc.3] - 2026-02-04

⚡ Remove Unnecessary Default Export Assignment

- Eliminates redundant variable assignments when exporting default values
- Reduces output bundle size and improves code clarity
```js
// index.js
var x = 42;
export default x;

// Before
var x = 42;
var entry_default = x;
export { entry_default as default };

// After
var x = 42;
export { x as default };
```

🐛 Avoid Unnecessary Facade Chunks

- Keep user-defined entry modules in their own chunks
- Reduces HTTP round trips and improves startup performance

```js
// main.js (entry module)
import { a } from './lib.js'
console.log(a)

// lib.js
export * from './counter.js'

// counter.js (entry module)
export const a = 100

// Before
dist/
├── main.js           → import { a } from './counter-chunk.js'; console.log(a)
├── counter.js        → export { a } from './counter-chunk.js' // ❌ facade chunk
└── counter-chunk.js  → export const a = 100

// After
dist/
├── main.js    → import { a } from './counter.js'; console.log(a)
└── counter.js → export const a = 100
```

### 🚀 Features

- expose `RUNTIME_MODULE_ID` constant for plugin authors (#8199) by @shulaoda
- warn unsupported combination of `preserveValueImports` and `importsNotUsedAsValues` in tsconfig.json (#8169) by @sapphi-red
- sophisticated watch tracking for load dependencies (#8092) by @sapphi-red
- add `inputMap` option to `minify` / `minifySync` functions (#8138) by @sapphi-red
- consolidate same tsconfig errors (#8119) by @sapphi-red
- include tsconfig file path in error messages (#8107) by @Copilot
- lazy-barrel: support incremental build mode (#8114) by @shulaoda

### 🐛 Bug Fixes

- rust: preserve dependencies added by `this.addWatchFile` (#8198) by @hyf0
- spawn `RuntimeModuleTask` after `build_start` to avoid race condition (#8182) by @shulaoda
- rust/dev: only close after the ongoing task finished (#8147) by @hyf0
- ensure `\0rolldown/runtime.js` will go through transform hook and add test (#8093) by @hyf0
- `[name]` in `assetFileNames` does not include the directory part (#8098) by @IWANABETHATGUY
- handle external module properties in namespace imports (#8124) by @IWANABETHATGUY
- keep user-defined entry modules in their own chunks (#8047) by @IWANABETHATGUY
- avoid `Unknown resolve error` error message (#8111) by @sapphi-red

### 💼 Other

- remove warnings  for building rolldown with `not(feature = "experimental")` (#8110) by @coolreader18

### 🚜 Refactor

- move `VERSION` to `constants` directory (#8200) by @shulaoda
- simplify import symbol check using `SymbolFlags` (#8193) by @shulaoda
- extract tsconfig option and transform options merging logic (#8168) by @sapphi-red
- filter empty module_groups before sorting (#8149) by @ShroXd
- lazy-barrel: use single `remove` instead of `contains_key` + `remove` (#8123) by @shulaoda
- lazy-barrel: avoid redundant call and inline `get_barrel_normal_module` (#8122) by @shulaoda
- use logger instead of console.log for warnings (#8117) by @IWANABETHATGUY
- module-loader: remove intermediate ModuleTaskOwnerRef type (#8113) by @shulaoda
- rename ReExportExternalModule to ReExportDynamicExports (#8104) by @IWANABETHATGUY

### 📚 Documentation

- add dynamic OG image generation (#8192) by @sapphi-red
- add dynamic OG image generation (#8191) by @sapphi-red
- add dynamic OG image generation (#8179) by @Copilot
- apis: add links to option descriptions in JSDoc comments (#8167) by @sapphi-red
- apis: clarify parameters of `resolveDynamicImport` hook (#8137) by @sapphi-red
- lazy-barrel: clarify default export behavior (#8128) by @shulaoda

### ⚡ Performance

- remove unnecessary assignment for default export (#8127) by @shulaoda

### 🧪 Testing

- dev: `this.addWatchFile` dependency should be preserved after reload (#8165) by @sapphi-red
- mark flaky `transform_runtime_module` test as ignored (#8178) by @Copilot
- rolldown_sourcemap: add test for coarse segments (#8166) by @sapphi-red
- dev: correctly assert file change (#8164) by @sapphi-red
- rust: `transform_runtime_module` test shouldn't panic inside (#8151) by @hyf0
- rust: fix flakiness of rust tests (#8150) by @hyf0
- mark `output.dynamicImportInCjs` tests as passed (#8125) by @shulaoda
- lazy-barrel: add test cases for default export (#8129) by @shulaoda
- rolldown_plugin_vite_manifest: use relative path for outPath (#8101) by @shulaoda

### ⚙️ Miscellaneous Tasks

- deps: update crate-ci/typos action to v1.43.1 (#8188) by @renovate[bot]
- deps: update rust crate ts-rs to v12 (#8160) by @renovate[bot]
- deps: update crate-ci/typos action to v1.43.0 (#8175) by @renovate[bot]
- deps: update rust crates (#8157) by @renovate[bot]
- deps: update oxc to v0.112.0 (#8171) by @renovate[bot]
- deps: update rollup submodule for tests to v4.57.1 (#8176) by @sapphi-red
- deps: update test262 submodule for tests (#8177) by @sapphi-red
- deps: update dependency oxlint to v1.43.0 (#8173) by @renovate[bot]
- deps: update dependency oxfmt to ^0.28.0 (#8170) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.8 (#8163) by @renovate[bot]
- deps: update dependency vue-router to v5 (#8159) by @renovate[bot]
- deps: update github-actions (#8158) by @renovate[bot]
- deps: update npm packages (#8156) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.11.4 (#8140) by @renovate[bot]
- fix clippy replacement typo (#8136) by @IWANABETHATGUY
- disallow `HashMap::new` and `HashSet::new` by clippy (#8135) by @sapphi-red
- deps: update dependency rolldown-plugin-dts to v0.21.7 (#8126) by @renovate[bot]
- deps: update oxc resolver to v11.17.0 (#8121) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.11.3 (#8109) by @renovate[bot]

### ❤️ New Contributors

* @coolreader18 made their first contribution in [#8110](#8110)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
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