Skip to content

Commit 1159b33

Browse files
committed
add opengraph info
1 parent a2d5f35 commit 1159b33

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

app/layout.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ const futuraPT = localFont({
2727
})
2828

2929
export const metadata: Metadata = {
30-
title: "DevSH Graphics Programming Sp. Z.O.O",
30+
title: "DevSH Graphics Programming",
31+
description: "The website of DevSH Graphics Programming",
32+
metadataBase: new URL("http://localhost:3000"),
33+
openGraph: {
34+
type: "website",
35+
title: "DevSH Graphics Programming",
36+
description: "The website of DevSH Graphics Programming",
37+
siteName: "DevSH Graphics Programming"
38+
}
3139
};
3240

3341
export const viewport: Viewport = {

app/opengraph-image.tsx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { ImageResponse } from "next/og";
2+
import { readFile } from "fs/promises";
3+
import { join } from "path";
4+
5+
export const alt = "About DevSH";
6+
export const size = {
7+
width: 256,
8+
height: 235
9+
}
10+
11+
export default async function OgImage() {
12+
const futurapt = await readFile(
13+
join(process.cwd(), 'app', 'fonts', 'FuturaPT', 'FuturaCyrillicMedium.ttf')
14+
);
15+
16+
const logoData = await readFile(
17+
join(process.cwd(), 'public', 'logo.png')
18+
);
19+
20+
const logoSrc = `data:image/png;base64,${logoData.toString('base64')}`
21+
22+
return new ImageResponse(
23+
(
24+
<div style={{
25+
display: 'flex',
26+
flexDirection: 'column',
27+
justifyItems: 'center',
28+
alignItems: 'center',
29+
width: '100%',
30+
height: '100%',
31+
background: '#000',
32+
color: '#fff'
33+
}}>
34+
<img src={logoSrc} alt="DevSH Logo"/>
35+
</div>
36+
),
37+
{
38+
...size,
39+
fonts: [
40+
{
41+
name: 'FuturaPT',
42+
data: futurapt,
43+
style: 'normal',
44+
weight: 400
45+
}
46+
]
47+
}
48+
)
49+
}

app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Link from "next/link";
12
import VulkanisedGallery from "./components/VulkanisedGallery";
23

34
export default function Home() {
@@ -6,6 +7,7 @@ export default function Home() {
67
<h1>Website Under Construction</h1>
78
<h3>Check out our Vulkanised videos below</h3>
89
<VulkanisedGallery/>
10+
<h3>And <Link href="https://youtube.com/watch?v=L0i_cO1iSEM&t=9343" className="text-teal-300 hover:underline" target="_blank" rel="noopener noreferer">MINE GameDev video</Link></h3>
911
</div>
1012
);
1113
}

0 commit comments

Comments
 (0)