You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(templates): add custom social preview images - #2602
Written by an AI agent on behalf of @HugoRCD, who shaped the solution. @HugoRCD has reviewed it.
Template links currently use the generic docs social image. Give the gallery its own image and each template a preview with its screenshot, category and source. Long titles and descriptions fit within the image, and starters have a code preview when no screenshot exists.
The OG component uses normal column layout, three title sizes and native two-line clamping. No custom Nuxt module or server layout hook is needed.
The font module update supplies the approved Outfit typography to the OG renderer. Images render at 1200 × 630.
Before and after
Before: current production. After: the local PR branch. Both captured at a 1200 × 630 viewport; the old images are 1200 × 600.
Templates gallery
Before
After
Individual template
Before
After
Long title, description and source
Validation
Production build and ESLint on the changed files passed.
Visually checked rendered gallery, normal title, long title/description/source and unbroken title previews. Removed the tests for the deleted measurement utility.
Unit suite: 704 passed; one translation test exceeded its five-second timeout. Its 29-test file passed when rerun with a 15-second timeout.
CI is rerunning for this update. Local type checking reports the existing layers/nuxi/nuxt.config.ts:10 error: eve is not a known Nuxt configuration property.
The initial Vercel preview failed in 0014_l10n_saves.sql: table l10n_saves already exists. This migration is unchanged by this PR.
When someone shares a template link, the preview now shows what that template looks like. Sharing the gallery shows a selection of templates instead.
No actionable comments were generated in the recent review.
Walkthrough
The change adds index and detail Open Graph layouts for template pages. The pages now pass template-specific content and dimensions to these layouts. Server-side code registers fonts, fits text to size limits, and positions layout elements. A Nuxt module registers the server plugin unless Open Graph images are disabled. Unit tests cover text fitting and layout positioning.
Template pages gain dedicated social previews; no merge-blocking regression was established.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly identifies the main change: custom social preview images for templates.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is related to the changeset. It explains that template links used the generic docs social image, and that the PR adds a gallery image, per-template previews with screenshot, category a…
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)
Full details: Description check
Explanation
The description is related to the changeset. It explains that template links used the generic docs social image, and that the PR adds a gallery image, per-template previews with screenshot, category and source, long-content fitting, starter code previews, the Outfit font module update, and 1200 × 630 rendering. It also lists validation steps and before/after images. The description is specific and on-topic, so it passes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: d0e1c257-4930-4da3-ac6d-79e05ada83ba
Commits
Reviewing files that changed from the base of the PR and between d4dc235 and 591e1a9.
Files selected for processing: 1
app/components/OgImage/Templates.takumi.vue
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
Initial page load counts the entry script, modulepreload chunks and stylesheets referenced by the prerendered HTML. Module values are attribution estimates from Nuxt’s analyzer. This workflow is report-only. 1d3e71e7 → 9246bbe3
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
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.
Written by an AI agent on behalf of @HugoRCD, who shaped the solution. @HugoRCD has reviewed it.
Template links currently use the generic docs social image. Give the gallery its own image and each template a preview with its screenshot, category and source. Long titles and descriptions fit within the image, and starters have a code preview when no screenshot exists.
The OG component uses normal column layout, three title sizes and native two-line clamping. No custom Nuxt module or server layout hook is needed.
The font module update supplies the approved Outfit typography to the OG renderer. Images render at 1200 × 630.
Before and after
Before: current production. After: the local PR branch. Both captured at a 1200 × 630 viewport; the old images are 1200 × 600.
Templates gallery
Individual template
Long title, description and source
Validation
layers/nuxi/nuxt.config.ts:10error:eveis not a known Nuxt configuration property.0014_l10n_saves.sql:table l10n_saves already exists. This migration is unchanged by this PR.When someone shares a template link, the preview now shows what that template looks like. Sharing the gallery shows a selection of templates instead.