Skip to content

Commit 7b61ade

Browse files
committedJan 12, 2022
feat(website): add an open graph image for the homepage
1 parent e7e7d8a commit 7b61ade

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed
 

‎website/src/pages/index.tsx

+23-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
import React from 'react'
2+
import { graphql, useStaticQuery } from 'gatsby'
23
import Home from '../components/home/Home'
34
import { Seo } from '../components/Seo'
45

5-
const IndexPage = () => (
6-
<>
7-
<Seo title="Home" keywords={[`gatsby`, `application`, `react`]} />
8-
<Home />
9-
</>
10-
)
6+
const IndexPage = () => {
7+
const {
8+
image: {
9+
childImageSharp: { gatsbyImageData: image },
10+
},
11+
} = useStaticQuery(graphql`
12+
query {
13+
image: file(absolutePath: { glob: "**/src/assets/captures/pages/home.png" }) {
14+
childImageSharp {
15+
gatsbyImageData(layout: FIXED, width: 1200, quality: 100)
16+
}
17+
}
18+
}
19+
`)
20+
21+
return (
22+
<>
23+
<Seo title="Home" keywords={[`dataviz`, `charts`, `react`, `svg`]} image={image} />
24+
<Home />
25+
</>
26+
)
27+
}
1128

1229
export default IndexPage

0 commit comments

Comments
 (0)
Please sign in to comment.