text: import React from "react";
  import Helmet from "react-helmet";
  import { graphql } from "gatsby";
  import Layout from "../components/layout";
  import PostLink from "../components/postLink";
  import HeroHeader from "../components/heroHeader";
  import FAQ from "../components/FAQ";
  
  const IndexPage = ({
    data: {
      site,
      allMarkdownRemark: { edges }
    }
  }) => {
    const Posts = edges
      .filter(edge => !!edge.node.frontmatter.date) // You can filter your posts based on some criteria
      .map(edge => <PostLink key={edge.node.id} post={edge.node} />);
  
    return (
      <Layout>
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
        <link
          href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300&display=swap"
          rel="stylesheet"
        />
        <Helmet>
          <title>{site.siteMetadata.title}</title>
          <meta name="description" content={site.siteMetadata.description} />
        </Helmet>
        <HeroHeader />
        <h2>Blog Posts &darr;</h2>
        <div className="grids">{Posts}</div>
        <FAQ />
      </Layout>
    );
  };
  
  export default IndexPage;
  export const pageQuery = graphql`
    query indexPageQuery {
      site {
        siteMetadata {
          title
          description
        }
      }
      allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) {
        edges {
          node {
            id
            excerpt(pruneLength: 250)
            frontmatter {
              date(formatString: "MMMM DD, YYYY")
              path
              title
              thumbnail
            }
          }
        }
      }
    }
  `;
  