Skip to content

Commit

Permalink
chore(prettier): prettify
Browse files Browse the repository at this point in the history
Signed-off-by: Irvan Malik <irvanmalik48@gmail.com>
  • Loading branch information
irvanmalik48 committed Jan 13, 2023
1 parent 8f70196 commit 8fed189
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion next-seo.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export function getProps(props: RealmPageProps): NextSeoProps {
description: props.desc,
images: [
{
url: "https://www.irvanma.me/api/og?title=" + encodeURIComponent(props.title!),
url:
"https://www.irvanma.me/api/og?title=" +
encodeURIComponent(props.title!),
width: 1200,
height: 630,
alt: "Realm | " + props.title,
Expand Down
15 changes: 7 additions & 8 deletions pages/api/og.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ export const config = {
runtime: "edge",
};

export default async function handler(
req: NextApiRequest
) {
const { searchParams } = new URL(req.url || '');
export default async function handler(req: NextApiRequest) {
const { searchParams } = new URL(req.url || "");

const hasTitle = searchParams.has('title');
const hasTitle = searchParams.has("title");
const title = hasTitle
? searchParams.get('title')?.slice(0, 100)
: 'The Realm';
? searchParams.get("title")?.slice(0, 100)
: "The Realm";

return new ImageResponse(
(
Expand Down Expand Up @@ -69,7 +67,8 @@ export default async function handler(
{title}
</div>
</div>
), {
),
{
width: 1200,
height: 627,
}
Expand Down

1 comment on commit 8fed189

@vercel
Copy link

@vercel vercel bot commented on 8fed189 Jan 13, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.