-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.tsx
55 lines (49 loc) · 1.31 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import {
HomepageCollections as Collections,
HomepageHero as Hero,
HomepageOverview as Overview,
HomepageWorks as Works,
} from "@/components/Homepage";
import Head from "next/head";
import { HomeContextProvider } from "@/context/home-context";
import Layout from "@/components/layout";
import { PRODUCTION_URL } from "@/lib/constants/endpoints";
import { buildDataLayer } from "@/lib/ga/data-layer";
import { loadDefaultStructuredData } from "@/lib/json-ld";
const HomePage: React.FC = () => {
return (
<>
<HomeContextProvider>
{/* Google Structured Data via JSON-LD */}
<Head>
<script
key="app-ld-json"
id="app-ld-json"
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(loadDefaultStructuredData(), null, "\t"),
}}
/>
</Head>
<Layout header="hero">
<Hero />
<Overview />
<Collections />
<Works />
</Layout>
</HomeContextProvider>
</>
);
};
export async function getStaticProps() {
const dataLayer = buildDataLayer({
pageTitle: "Homepage",
});
const openGraphData = {
"og:url": PRODUCTION_URL,
};
return {
props: { dataLayer, openGraphData },
};
}
export default HomePage;