1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-16 01:55:18 +01:00
blog/src/hooks/use-site-metadata.ts

40 lines
737 B
TypeScript
Raw Normal View History

2019-10-02 15:32:01 +02:00
import { useStaticQuery, graphql } from 'gatsby'
2019-10-28 23:00:55 +01:00
import { Site } from '../@types/Site'
2019-10-02 15:32:01 +02:00
2019-10-28 23:00:55 +01:00
export function useSiteMetadata(): Site {
2019-10-13 19:08:36 +02:00
const query = graphql`
query {
site {
siteMetadata {
siteTitle
siteTitleShort
siteDescription
siteUrl
author {
name
email
uri
twitter
github
facebook
bitcoin
ether
}
typekitID
menu {
title
link
}
rss
jsonfeed
itemsPerPage
repoContentPath
2019-10-02 15:32:01 +02:00
}
}
}
2019-10-13 19:08:36 +02:00
`
2019-10-02 15:32:01 +02:00
const { site } = useStaticQuery(query)
return site.siteMetadata
}