import React from 'react'; import { Link, graphql } from 'gatsby' import Layout from '../components/Layout/Layout' import SEO from '../components/SEO/SEO' const IndexPage = ({ data: { articles: { edges } } }) => { return ( <> Articles ({ edges.length }): {edges.map(({ node }, i) => ( {node.frontmatter.title} {node.frontmatter.date} {node.frontmatter.description} ))} > ) } export const query = graphql` { articles: allMarkdownRemark( filter: { frontmatter: { templateKey: { eq: "article" } } } sort: { order: DESC, fields: frontmatter___date } ) { edges { node { frontmatter { slug title date(formatString: "D MMMM YYYY", locale: "ru-RU") description } } } } } ` export default IndexPage
{node.frontmatter.description}