mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 17:05:50 +02:00
17 lines
305 B
TypeScript
17 lines
305 B
TypeScript
|
import { graphql, useStaticQuery } from 'gatsby';
|
||
|
|
||
|
const useDocContext = (): string => {
|
||
|
const result = useStaticQuery(graphql`
|
||
|
query {
|
||
|
site {
|
||
|
siteMetadata {
|
||
|
context
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`);
|
||
|
|
||
|
return result.site.siteMetadata.context;
|
||
|
};
|
||
|
|
||
|
export default useDocContext;
|