text: import { graphql, useStaticQuery } from 'gatsby';
  
  const usePosts = () => {
    const data = useStaticQuery(graphql`
      query {
        allMdx {
          nodes {
            frontmatter {
              title
              author
              slug
              image {
                sharp: childImageSharp {
                  fluid(
                    maxWidth: 100
                    maxHeight: 100
                    duotone: { shadow: "#035b45", highlight: "#69f4c6"}
                  ) {
                    ...GatsbyImageSharpFluid_withWebp
                  }
                }
              }
            }
            excerpt
          }
        }
      }
    `);
  
    return data.allMdx.nodes.map(post => ({
      title: post.frontmatter.title,
      author: post.frontmatter.author,
      slug: post.frontmatter.slug,
      image: post.frontmatter.image,
      excerpt: post.excerpt,
    }));
  };
  
  export default usePosts;