{"size": 608, "ext": "js", "max_stars_repo_path": "src/query-hooks/use-pages.js", "max_stars_repo_name": "warmeta/warmeta-web", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/query-hooks/use-pages.js", "max_issues_repo_name": "warmeta/warmeta-web", "max_issues_repo_issues_event_min_datetime": "2020-09-04T03:31:43.000Z", "max_issues_repo_issues_event_max_datetime": "2020-09-04T03:31:43.000Z", "max_forks_repo_path": "src/query-hooks/use-pages.js", "max_forks_repo_name": "warmeta/warmeta-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 20.2666666667, "max_line_length": 60, "alphanum_fraction": 0.4473684211}
import { useStaticQuery, graphql } from 'gatsby';
import get from 'lodash/get';

const usePages = () => {
  const data = useStaticQuery(
    graphql`
      query Pages {
        allMdx(
          filter: { fileAbsolutePath: { regex: "/pages/" } }
          sort: { order: ASC, fields: frontmatter___title }
        ) {
          edges {
            node {
              frontmatter {
                title
                path
                date
                excerpt
              }
            }
          }
        }
      }
    `
  );
  return get(data, 'allMdx.edges');
};

export default usePages;
