text: exports.createPages = async ({ actions, graphql, reporter }) => {
    const { createPage } = actions;
  
    const blogPostTemplate = require.resolve('./src/templates/projectTemplate.tsx');
  
    const result = await graphql(`
      {
        allMarkdownRemark(
          limit: 100
        ) {
          edges {
            node {
              frontmatter {
                slug
              }
            }
          }
        }
      }
    `);
  
    // Handle errors
    if (result.errors) {
      reporter.panicOnBuild('Error while running GraphQL query.');
      return;
    }
  
    result.data.allMarkdownRemark.edges.forEach(({ node }) => {
      createPage({
        path: `/work/${node.frontmatter.slug}`,
        component: blogPostTemplate,
        context: {
          // additional data can be passed via context
          slug: node.frontmatter.slug,
        },
      });
    });
  };
  