Skip to content

Use Next image optimization for docs template covers#4

Open
caorushizi wants to merge 1 commit into
masterfrom
codex/vercel-next-image-optimization
Open

Use Next image optimization for docs template covers#4
caorushizi wants to merge 1 commit into
masterfrom
codex/vercel-next-image-optimization

Conversation

@caorushizi
Copy link
Copy Markdown
Contributor

Summary

  • switch docs deployment config back to Vercel's managed Next.js runtime
  • replace template cover tags with a shared next/image wrapper
  • keep docs pages statically prerendered while enabling Vercel image optimization

Verification

  • pnpm docs:build
  • verified local next/image route returns optimized WebP output

Copilot AI review requested due to automatic review settings May 17, 2026 15:00
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
one-cli-docs Ready Ready Preview, Comment May 17, 2026 3:02pm

Copy link
Copy Markdown

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

Switches the docs site from static export to Vercel's managed Next.js runtime so that next/image optimization can be used for template cover images, and introduces a small wrapper component to centralize the image configuration.

Changes:

  • Remove output: "export" / images.unoptimized from next.config.mjs and add outputFileTracingRoot; set framework: "nextjs" in both vercel.json files and drop the explicit outputDirectory.
  • Add TemplateCoverImage, a thin wrapper around next/image with fill plus required sizes.
  • Replace raw <img> tags for example covers in the listing and detail components with TemplateCoverImage, adding a relative aspect-[16/10] parent on the detail hero so fill works.

Reviewed changes

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

Show a summary per file
File Description
vercel.json Switch framework to nextjs and drop static outputDirectory.
apps/docs/vercel.json Same framework/output change for the docs-scoped config.
apps/docs/next.config.mjs Remove static export + image-unoptimized settings; add outputFileTracingRoot for the monorepo.
apps/docs/src/components/template-cover-image.tsx New next/image wrapper using fill and forced sizes.
apps/docs/src/components/template-examples-list.tsx Use TemplateCoverImage for example cards with responsive sizes.
apps/docs/src/components/template-example-detail.tsx Use TemplateCoverImage for the hero (with priority) and related cards; add relative aspect-[16/10] wrapper.

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

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.

3 participants