-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 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,5 @@ | ||
--- | ||
"web": minor | ||
--- | ||
|
||
Use SVG favicon |
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,34 @@ | ||
import { ImageResponse } from 'next/og'; | ||
import { Logo } from '../components/logo'; | ||
|
||
// Image metadata | ||
export const size = { | ||
width: 32, | ||
height: 32, | ||
}; | ||
export const contentType = 'image/png'; | ||
|
||
// Image generation | ||
export default function Icon() { | ||
return new ImageResponse( | ||
( | ||
// ImageResponse JSX element | ||
<div | ||
style={{ | ||
width: '100%', | ||
height: '100%', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
<Logo variant="compact" style={{ width: '100%', height: 'auto' }} /> | ||
</div> | ||
), | ||
// ImageResponse options | ||
{ | ||
// For convenience, we can re-use the exported icons size metadata | ||
// config to also set the ImageResponse's width and height. | ||
...size, | ||
} | ||
); | ||
} |