Closed gringrape closed 1 year ago
페이지에서 Head
컴포넌트를 지정하고 export
한다.
page
:
Copysrc/pages/index.jsx: copy code to clipboard
import React from "react"
import { SEO } from "../components/seo"
const IndexPage = () => {
return (
<main>
Hello World
</main>
)
}
export default IndexPage
export const Head = () => (
<SEO />
)
docs: https://www.gatsbyjs.com/docs/how-to/adding-common-features/adding-seo-component/
index
페이지에 지정 후 사용
another page
:
import React from "react"
const Page = () => {
return (
<h1>
Hello World
</h1>
)
}
export default Page
export { Head } from './index'
resolved in PR: https://github.com/gringrape/gringrape.github.io/pull/7
예시
gatsby-config.js
:docs: https://www.gatsbyjs.com/docs/how-to/adding-common-features/adding-seo-component/