diff --git a/src/layouts/index.js b/src/layouts/index.js index 0141ef9..1a98bc0 100644 --- a/src/layouts/index.js +++ b/src/layouts/index.js @@ -11,7 +11,7 @@ import '../styles/custom.css' const Layout = ({ children, data }) => (
( +const IndexPage = ({ ...props }) => (
@@ -148,8 +148,22 @@ const IndexPage = () => ( headline="But occasionally we find the time to have fun and publish stuff" />
- - + {props.data.allWordpressPost.edges.map(({ node }) => ( +
+ +
+ ))}
) +export const query = graphql` + query indexPostsQuery { + allWordpressPost { + edges { + node { + id + title + excerpt + status + slug + date(formatString: "MMMM DD, YYYY") + featured_media { + localFile { + childImageSharp { + resolutions(width: 600, height: 300) { + src + width + height + } + } + } + } + } + } + } + } +` + export default IndexPage