Basic config and layout for fetching, showing wp data with graphql
This commit is contained in:
35
src/layouts/index.js
Normal file
35
src/layouts/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import Helmet from 'react-helmet'
|
||||
|
||||
import Header from '../components/header'
|
||||
|
||||
const Layout = ({ children, data }) => (
|
||||
<div>
|
||||
<Helmet
|
||||
title={data.site.siteMetadata.title}
|
||||
meta={[
|
||||
{ name: 'description', content: 'We code & design great software' },
|
||||
{ name: 'keywords', content: 'software, design, coding, programming, code, consulting' },
|
||||
]}
|
||||
/>
|
||||
<Header siteTitle={data.site.siteMetadata.title} />
|
||||
{children()}
|
||||
</div>
|
||||
)
|
||||
|
||||
Layout.propTypes = {
|
||||
children: PropTypes.func,
|
||||
}
|
||||
|
||||
export default Layout
|
||||
|
||||
export const query = graphql`
|
||||
query SiteTitleQuery {
|
||||
site {
|
||||
siteMetadata {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
Reference in New Issue
Block a user