Skip to content

feat: add og.png#1

Open
himself65 wants to merge 1 commit intomainfrom
og
Open

feat: add og.png#1
himself65 wants to merge 1 commit intomainfrom
og

Conversation

@himself65
Copy link
Copy Markdown

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 22, 2025

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

Project Deployment Preview Comments Updated (UTC)
lmrouter-docs Ready Ready Preview Comment Sep 22, 2025 8:43pm

@yvbbrjdr
Copy link
Copy Markdown
Contributor

Is this vibe coded?

@yvbbrjdr yvbbrjdr added the enhancement New feature or request label Sep 24, 2025
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

This PR adds dynamic Open Graph image generation functionality to the LMRouter documentation site. It implements a server-side image generation API endpoint that creates branded social media preview images.

Key changes:

  • Added a new API endpoint /api/og/route.tsx that generates dynamic OG images with custom title, description, and type parameters
  • Updated documentation page metadata to include Open Graph and Twitter card configurations
  • Added @vercel/og dependency for server-side image generation

Reviewed Changes

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

File Description
src/app/api/og/route.tsx New API endpoint that generates dynamic OG images with LMRouter branding and custom content
src/app/(docs)/[[...slug]]/page.tsx Enhanced metadata generation to include Open Graph and Twitter card configurations
package.json Added @vercel/og dependency for image generation functionality
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +49 to +85
<svg
style={{
position: "absolute",
top: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M0,10 L10,10 L10,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
top: "30px",
right: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M10,10 L10,0 L20,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
bottom: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The corner decoration SVGs have duplicated styling properties (fill='white' and opacity='0.4'). Consider extracting these common properties into a shared style object or constant to reduce duplication and improve maintainability.

Suggested change
<svg
style={{
position: "absolute",
top: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M0,10 L10,10 L10,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
top: "30px",
right: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M10,10 L10,0 L20,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
bottom: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
{/*
Extracted common SVG properties for corner decorations
*/}
{/*
Define shared props for corner SVGs
*/}
{/*
Place this constant just before the SVGs
*/}
{(() => {
const cornerSvgProps = { fill: "white", opacity: "0.4" };
return (
<>
<svg
style={{
position: "absolute",
top: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
{...cornerSvgProps}
>
<path d="M0,10 L10,10 L10,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
top: "30px",
right: "30px",
width: "20px",
height: "20px",
}}
{...cornerSvgProps}
>
<path d="M10,10 L10,0 L20,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
bottom: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
{...cornerSvgProps}
>

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +91
<svg
style={{
position: "absolute",
top: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M0,10 L10,10 L10,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
top: "30px",
right: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M10,10 L10,0 L20,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
bottom: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M0,10 L10,10 L10,20" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
bottom: "30px",
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The corner decoration SVGs have duplicated styling properties (fill='white' and opacity='0.4'). Consider extracting these common properties into a shared style object or constant to reduce duplication and improve maintainability.

Suggested change
<svg
style={{
position: "absolute",
top: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M0,10 L10,10 L10,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
top: "30px",
right: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M10,10 L10,0 L20,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
bottom: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
fill="white"
opacity="0.4"
>
<path d="M0,10 L10,10 L10,20" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
bottom: "30px",
{/*
Shared SVG props for corner decorations
*/}
{(() => {
const cornerSvgProps = {
fill: "white",
opacity: "0.4",
};
return (
<>
<svg
style={{
position: "absolute",
top: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
{...cornerSvgProps}
>
<path d="M0,10 L10,10 L10,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
top: "30px",
right: "30px",
width: "20px",
height: "20px",
}}
{...cornerSvgProps}
>
<path d="M10,10 L10,0 L20,0" stroke="white" strokeWidth="2" fill="none" />
</svg>
<svg
style={{
position: "absolute",
bottom: "30px",
left: "30px",
width: "20px",
height: "20px",
}}
{...cornerSvgProps}
>
<path d="M0,10 L10,10 L10,20" stroke="white" strokeWidth="2" fill="none" />
</svg>
</>
);
})()}
<svg
style={{
position: "absolute",
bottom: "30px",

Copilot uses AI. Check for mistakes.
Comment on lines +83 to +84
fill="white"
opacity="0.4"
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The corner decoration SVGs have duplicated styling properties (fill='white' and opacity='0.4'). Consider extracting these common properties into a shared style object or constant to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +97
fill="white"
opacity="0.4"
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The corner decoration SVGs have duplicated styling properties (fill='white' and opacity='0.4'). Consider extracting these common properties into a shared style object or constant to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
{/* Title */}
<h1
style={{
fontSize: title.length > 30 ? "56px" : "64px",
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The magic number 30 for title length threshold should be extracted as a named constant to make the logic more maintainable and self-documenting.

Copilot uses AI. Check for mistakes.
const page = source.getPage(params.slug);
if (!page) notFound();

const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this envvar automatically set by Vercel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants