-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs OG and add image response demo for vercel (#817)
* Docs update test * vercel og update
- Loading branch information
Showing
8 changed files
with
1,040 additions
and
291 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ImageResponse } from "@vercel/og"; | ||
|
||
export const config = { | ||
runtime: "experimental-edge", | ||
}; | ||
|
||
export default function GET(request: Request) { | ||
const { searchParams } = new URL(request.url); | ||
|
||
const title = searchParams.get("title"); | ||
const description = searchParams.get("description"); | ||
|
||
return new ImageResponse( | ||
( | ||
<div | ||
style={{ | ||
display: "flex", | ||
fontSize: 128, | ||
background: "white", | ||
width: "100%", | ||
height: "100%", | ||
gap: 40, | ||
}} | ||
> | ||
<img src="/og-trim.png" alt="ZORA" /> | ||
{title && <div style={{}}>{title}</div>} | ||
{description && <div style={{ fontSize: 18 }}>{description}</div>} | ||
</div> | ||
), | ||
); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Oops, something went wrong.