From 7b61ade41aea5c2947ed1beb310a1f07b3418528 Mon Sep 17 00:00:00 2001 From: plouc Date: Thu, 13 Jan 2022 01:22:05 +0900 Subject: [PATCH] feat(website): add an open graph image for the homepage --- website/src/pages/index.tsx | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 08b008ece..818dbd366 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -1,12 +1,29 @@ import React from 'react' +import { graphql, useStaticQuery } from 'gatsby' import Home from '../components/home/Home' import { Seo } from '../components/Seo' -const IndexPage = () => ( - <> - - - -) +const IndexPage = () => { + const { + image: { + childImageSharp: { gatsbyImageData: image }, + }, + } = useStaticQuery(graphql` + query { + image: file(absolutePath: { glob: "**/src/assets/captures/pages/home.png" }) { + childImageSharp { + gatsbyImageData(layout: FIXED, width: 1200, quality: 100) + } + } + } + `) + + return ( + <> + + + + ) +} export default IndexPage