text: import { graphql, useStaticQuery } from 'gatsby';
  
  const useProjects = () => {
    const data = useStaticQuery(graphql`
      query {
        allMdx(
          sort: { fields: frontmatter___date, order: DESC }
          filter: { frontmatter: { type: { eq: "project" } } }
        ) {
          nodes {
            frontmatter {
              title
              slug
              author
              topic
              link
              image {
                sharp: childImageSharp {
                  fluid {
                    ...GatsbyImageSharpFluid_withWebp
                  }
                }
              }
            }
            excerpt
          }
        }
      }
    `);
    return data.allMdx.nodes.map(post => ({
      title: post.frontmatter.title,
      author: post.frontmatter.author,
      slug: post.frontmatter.slug,
      excerpt: post.excerpt,
      image: post.frontmatter.image,
      topic: post.frontmatter.topic,
      link: post.frontmatter.link,
    }));
  };
  export default useProjects;
  