Skip to content

Commit

Permalink
add site metadata component for useStaticQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
spences10 committed Mar 15, 2019
1 parent f5790e4 commit 3865bbe
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/SiteMetadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { graphql, useStaticQuery } from 'gatsby'

const useSiteMetadata = () => {
const { site } = useStaticQuery(
graphql`
query SITE_METADATA_QUERY {
site {
siteMetadata {
title
description
}
}
}
`
)
return site.siteMetadata
}

export default useSiteMetadata

0 comments on commit 3865bbe

Please sign in to comment.