Skip to content

Commit e61a7bc

Browse files
authored
Fix: Open Graph Image is Missing (#28)
* Fix: Open Graph Image is Missing * Fix open graph * fix opengraph
1 parent fcf349e commit e61a7bc

File tree

6 files changed

+54
-33
lines changed

6 files changed

+54
-33
lines changed

app/(inferenceai)/inferenceai/rag-chatbot/[lang]/data.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ import {
4646
ReloadIcon
4747
} from "@radix-ui/react-icons";
4848

49+
export const data = {
50+
name: "RAG Chatbot",
51+
baseUrl: "https://hyperjump.tech/inferenceai/rag-chatbot"
52+
};
53+
4954
export const navRagChatbot = (lang: SupportedLanguage) => {
5055
const data = [
5156
{ label: ragChatbotNavItems0Label(lang), href: "#key-features" },

app/(inferenceai)/inferenceai/rag-chatbot/page.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
1+
import {
2+
ragChatbotHeroDesc,
3+
ragChatbotHeroHeading
4+
} from "@/locales/.generated/server";
15
import RagChatbotLangLayout from "./[lang]/layout";
26
import RagChatbotPage from "./[lang]/page";
7+
import { data } from "./[lang]/data";
8+
import { Metadata } from "next";
9+
10+
export async function generateMetadata(): Promise<Metadata> {
11+
const { baseUrl, name } = data;
12+
const title = `${name} - ${ragChatbotHeroHeading("en")}`;
13+
14+
return {
15+
description: ragChatbotHeroDesc("en"),
16+
title,
17+
openGraph: {
18+
url: baseUrl,
19+
type: "website",
20+
title,
21+
images: [
22+
{
23+
url: "https://hyperjump.tech/images/inferenceai/inference-ai-og.png",
24+
width: 1200,
25+
height: 630,
26+
alt: `${name} Logo`,
27+
type: "image/png"
28+
}
29+
],
30+
siteName: name
31+
}
32+
};
33+
}
334

435
export default function NoLangRagChatbot() {
536
return (

app/(main)/[lang]/home.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,13 @@ import { Button } from "@/components/ui/button";
3333
import Link from "next/link";
3434

3535
const {
36-
hero: { heading, subheading },
36+
hero: { subheading },
3737
location,
3838
socials,
3939
title,
4040
url
4141
} = data;
4242

43-
export const metadata: Metadata = {
44-
description: subheading,
45-
title: `${title} - ${heading}`,
46-
openGraph: {
47-
url,
48-
type: "website",
49-
title: `${title} - ${heading}`,
50-
images: [
51-
{
52-
url: "https://hyperjump.tech/images/hyperjump-og.png",
53-
width: 1200,
54-
height: 630,
55-
alt: "Hyperjump Logo",
56-
type: "image/png"
57-
}
58-
],
59-
siteName: title
60-
}
61-
};
62-
6343
export default function Home({ lang }: { lang: SupportedLanguage }) {
6444
return (
6545
<>

app/(services)/services/[lang]/home.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ import {
3131
servicesCtaHeading,
3232
servicesCtaDesc,
3333
servicesPartnersHeading,
34-
servicesPartnersDesc,
35-
servicesSeeMore
34+
servicesPartnersDesc
3635
} from "@/locales/.generated/server";
3736
import { ServiceCard } from "../components/service-card";
3837
import { Button } from "@/components/ui/button";
@@ -61,7 +60,6 @@ export default function Home({ lang }: { lang: SupportedLanguage }) {
6160
]}
6261
image="/images/services/ctoaas.webp"
6362
icon="/images/services/ctoaas-icon.svg"
64-
seeMoreText={servicesSeeMore(lang)}
6563
/>
6664

6765
<ServiceCard
@@ -76,7 +74,6 @@ export default function Home({ lang }: { lang: SupportedLanguage }) {
7674
image="/images/services/saas.webp"
7775
icon="/images/services/saas-icon.svg"
7876
reverse
79-
seeMoreText={servicesSeeMore(lang)}
8077
/>
8178

8279
<ServiceCard
@@ -90,7 +87,6 @@ export default function Home({ lang }: { lang: SupportedLanguage }) {
9087
]}
9188
image="/images/services/tech-due-diligence.webp"
9289
icon="/images/services/tech-due-diligence-icon.svg"
93-
seeMoreText={servicesSeeMore(lang)}
9490
/>
9591

9692
<ServiceCard
@@ -106,7 +102,6 @@ export default function Home({ lang }: { lang: SupportedLanguage }) {
106102
icon="/images/services/erp-icon.svg"
107103
withBorder={false}
108104
reverse
109-
seeMoreText={servicesSeeMore(lang)}
110105
/>
111106
</section>
112107

app/(services)/services/components/service-card.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import Image from "next/image";
2-
import { Button } from "@/components/ui/button";
3-
import Link from "next/link";
42

53
interface ServiceCardProps {
64
title: string;
@@ -9,9 +7,7 @@ interface ServiceCardProps {
97
items: string[];
108
image: string;
119
icon: string;
12-
url?: string;
1310
reverse?: boolean;
14-
seeMoreText?: string;
1511
withBorder?: boolean;
1612
}
1713

@@ -23,8 +19,6 @@ export function ServiceCard({
2319
image,
2420
icon,
2521
reverse,
26-
seeMoreText,
27-
url = "#",
2822
withBorder = true
2923
}: ServiceCardProps) {
3024
return (

app/layout.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ export const metadata: Metadata = {
2323
icon: "/icons/icon-192x192.png",
2424
apple: "/icons/apple-touch-icon.png",
2525
shortcut: "/icons/icon-192x192.png"
26+
},
27+
openGraph: {
28+
title: data.title,
29+
description: data.description,
30+
type: "website",
31+
url: data.url,
32+
siteName: data.title,
33+
images: [
34+
{
35+
url: "https://hyperjump.tech/images/hyperjump-og.png",
36+
width: 1200,
37+
height: 630,
38+
alt: `${data.title} Logo`,
39+
type: "image/png"
40+
}
41+
]
2642
}
2743
};
2844

0 commit comments

Comments
 (0)