Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gurubu-client): open graph image generator added #122

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Binary file added gurubu-client/public/logo-with-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions gurubu-client/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Metadata } from "next";
import { Inter, Space_Grotesk } from "next/font/google";
import classNames from "classnames";
import "@/styles/globals.scss";
Expand All @@ -9,11 +8,6 @@ const spaceGrotesk = Space_Grotesk({
variable: "--font-space-grotesk",
});

export const metadata: Metadata = {
title: "Gurubu | Simple, fast and practical grooming",
description: "Simple, fast and practical grooming.",
};

export default function RootLayout({
children,
}: {
Expand Down
42 changes: 42 additions & 0 deletions gurubu-client/src/app/opengraph-image.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { ImageResponse } from "next/og";
import { CSSProperties } from "react";

export const contentType = "image/png";

const imageStyle: CSSProperties = {
backgroundColor: "#ffffff",
backgroundSize: "150px 150px",
height: "100%",
width: "100%",
display: "flex",
textAlign: "center",
alignItems: "center",
justifyContent: "center",
flexDirection: "column",
flexWrap: "nowrap",
fontSize: "48px",
};

export const size = {
width: 1200,
height: 630,
};

export default async function Image() {
return new ImageResponse(
(
<div style={imageStyle}>
<img
width={372}
height={90}
src={"https://gurubu.vercel.app/gurubu-logo.svg"}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
src={"https://gurubu.vercel.app/gurubu-logo.svg"}
src={"/gurubu-logo.svg"}

alt="GuruBu logo"
/>
Simple, fast and practical grooming.
</div>
),
{
...size,
}
);
}