Skip to content

Commit 4b3c648

Browse files
authored
Added Open Graph and JSON-LD (#13)
* fix: footer background on mobile screen * fix: typos * feat: add og and json ld * fix: failed pipeline * feat: add address and duns number
1 parent f7938ef commit 4b3c648

File tree

6 files changed

+98
-3
lines changed

6 files changed

+98
-3
lines changed

app/(main)/page.tsx

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Image from "next/image";
22
import Link from "next/link";
3+
import type { Metadata } from "next";
4+
import type { Organization, WebPage, WithContext } from "schema-dts";
35

46
import {
57
Accordion,
@@ -17,7 +19,34 @@ import GridItemsContainer, {
1719
import data from "@/data.json";
1820
import { CaseStudiesCTA } from "./components/case-studies-cta";
1921

20-
const { cta, location } = data;
22+
const {
23+
cta,
24+
hero: { heading, subheading },
25+
location,
26+
socials,
27+
title,
28+
url
29+
} = data;
30+
31+
export const metadata: Metadata = {
32+
description: subheading,
33+
title: `${title} - ${heading}`,
34+
openGraph: {
35+
url,
36+
type: "website",
37+
title: `${title} - ${heading}`,
38+
images: [
39+
{
40+
url: "https://hyperjump.tech/images/hyperjump-og.png",
41+
width: 1200,
42+
height: 630,
43+
alt: "Hyperjump Logo",
44+
type: "image/png"
45+
}
46+
],
47+
siteName: title
48+
}
49+
};
2150

2251
export default function Home() {
2352
return (
@@ -27,6 +56,7 @@ export default function Home() {
2756
<OpenSourceProducts />
2857
<Faqs />
2958
<Location />
59+
<JsonLd />
3060
</>
3161
);
3262
}
@@ -200,3 +230,63 @@ function Location() {
200230
</GridItemsContainer>
201231
);
202232
}
233+
234+
function JsonLd() {
235+
return (
236+
<>
237+
<JsonLdOrganization />
238+
<JsonLdWebsite />
239+
</>
240+
);
241+
}
242+
243+
function JsonLdOrganization() {
244+
const jsonLd: WithContext<Organization> = {
245+
"@context": "https://schema.org",
246+
"@type": "Organization",
247+
name: title,
248+
url,
249+
logo: "https://hyperjump.tech/images/hyperjump-colored.png",
250+
address: {
251+
"@type": "PostalAddress",
252+
streetAddress: "D.Lab Building (6th floor), Jl. Riau No. 1",
253+
addressLocality: "Gondangdia, Menteng, Jakarta Pusat",
254+
addressRegion: "DKI Jakarta",
255+
postalCode: "10350",
256+
addressCountry: "ID"
257+
},
258+
contactPoint: {
259+
"@type": "ContactPoint",
260+
email: location.email,
261+
contactType: "Sales",
262+
areaServed: "Worldwide",
263+
availableLanguage: ["English", "Indonesian"]
264+
},
265+
sameAs: socials.map(({ url }) => url),
266+
duns: location.duns
267+
};
268+
269+
return (
270+
<script
271+
type="application/ld+json"
272+
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
273+
/>
274+
);
275+
}
276+
277+
function JsonLdWebsite() {
278+
const jsonLd: WithContext<WebPage> = {
279+
"@context": "https://schema.org",
280+
"@type": "WebPage",
281+
name: title,
282+
url,
283+
description: subheading
284+
};
285+
286+
return (
287+
<script
288+
type="application/ld+json"
289+
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
290+
/>
291+
);
292+
}

app/components/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Footer() {
1111
alt="Footer background"
1212
width={1440}
1313
height={308}
14-
className="pointer-events-none w-full select-none"
14+
className="pointer-events-none h-full w-full select-none"
1515
style={{
1616
background: "linear-gradient(44.24deg, #0D0B1E 0%, #161D29 109.69%)"
1717
}}

app/components/nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export function NavContainer({ children }: { children: ReactNode }) {
152152
return () => window.removeEventListener("scroll", handleScroll);
153153
}, []);
154154

155-
const showBorder = isScrolled ? "boder border-b-2" : "boder-none2";
155+
const showBorder = isScrolled ? "border border-b-2" : "border-none";
156156

157157
return (
158158
<div

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
{ "label": "Open Source", "href": "#open-source" },
3333
{ "label": "FAQ", "href": "#faqs" }
3434
],
35+
"url": "https://hyperjump.tech",
3536
"clients": [
3637
{
3738
"name": "Amman Mineral Internasional",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"next-themes": "^0.3.0",
2929
"react": "^18",
3030
"react-dom": "^18",
31+
"schema-dts": "^1.1.5",
3132
"sonner": "2.0.3",
3233
"tailwindcss-animate": "^1.0.7"
3334
},

0 commit comments

Comments
 (0)