Skip to content

Instantly share code, notes, and snippets.

@canertuzunar
Created April 14, 2021 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canertuzunar/b3d6a0fcb80e4e5d92af7a659931c9a1 to your computer and use it in GitHub Desktop.
Save canertuzunar/b3d6a0fcb80e4e5d92af7a659931c9a1 to your computer and use it in GitHub Desktop.
//src/pages/index.js
import React from 'react'
import { graphql, Link } from 'gatsby'
export default function IndexPage({data}) {
return(
<>
<h1>Gatsby Blog</h1>
<h3>this project created for provide resource to this <a href="https://www.notion.so/tuzunarcaner/Statik-Web-Sitesi-ve-Gatsby-JS-f2a902d281b04c8cb3b0ac97ef49fdf5">
article
</a></h3>
<ul>
{
data.allMarkdownRemark.edges.map(({node}) => {
return <li>
<Link to={node.fields.slug}> {node.frontmatter.title} </Link>
</li>
})
}
</ul>
</>
)
}
export const query = graphql`
query HomeQuery {
allMarkdownRemark(filter: {fileAbsolutePath: {regex: "/blog/"}}) {
edges {
node {
fields {
slug
}
frontmatter{
title
}
}
}
}
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment