Create blog page
This commit is contained in:
parent
2ea1416b2e
commit
ca7d9f7c81
|
@ -0,0 +1,40 @@
|
|||
import React from "react"
|
||||
import { useStaticQuery, graphql } from "gatsby"
|
||||
|
||||
import Layout from "../components/layout"
|
||||
import Blog from "../components/blog"
|
||||
|
||||
import "../styles/global.scss"
|
||||
|
||||
const IndexPage = () => {
|
||||
|
||||
const data = useStaticQuery(graphql`
|
||||
query {
|
||||
allMarkdownRemark(
|
||||
sort: { order: DESC, fields: [frontmatter___date] }
|
||||
filter: {frontmatter: {draft: {ne: true}}}
|
||||
) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
excerpt
|
||||
frontmatter {
|
||||
date
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
console.log(data.allMarkdownRemark.edges)
|
||||
|
||||
return (
|
||||
<Layout title="Home">
|
||||
<Blog edges={data.allMarkdownRemark.edges}/>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export default IndexPage
|
Loading…
Reference in New Issue