Skip to content

Commit

Permalink
feat: automatically create pages from the data in the component sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jan 28, 2021
1 parent a17e352 commit 4f7f9aa
Show file tree
Hide file tree
Showing 87 changed files with 29 additions and 611 deletions.
28 changes: 26 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
const { createPage, createRedirect } = actions;

const result = await graphql(`
{
query {
allMdx(
limit: 1000
filter: { fileAbsolutePath: { regex: "/src/markdown-pages/" } }
Expand All @@ -35,6 +35,16 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
}
}
}
allNewRelicSdkComponent {
edges {
node {
fields {
slug
}
}
}
}
}
`);

Expand All @@ -44,7 +54,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
return;
}

const { allMdx } = result.data;
const { allMdx, allNewRelicSdkComponent } = result.data;

allMdx.edges.forEach(({ node }) => {
const { frontmatter } = node;
Expand Down Expand Up @@ -76,6 +86,20 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
},
});
});

allNewRelicSdkComponent.edges.forEach(({ node }) => {
const {
fields: { slug },
} = node;

createPage({
path: slug,
component: path.resolve('./src/templates/ComponentReferenceTemplate.js'),
context: {
slug,
},
});
});
};

exports.onCreateNode = ({ node, actions }) => {
Expand Down
7 changes: 0 additions & 7 deletions src/markdown-pages/components/account-picker.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/account-storage-mutation.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/account-storage-query.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/accounts-query.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/auto-sizer.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/badge.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/block-text.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/button.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/card-body.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/card-header.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/card.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/area-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/bar-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/billboard-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/chart-group.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/funnel-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/histogram-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/json-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/line-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/pie-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/scatter-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/sparkline-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/stacked-bar-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/charts/table-chart.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/checkbox.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/dropdown-item.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/dropdown-section.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/dropdown.mdx

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/entities-by-guids-query.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/entities-by-name-query.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/entity-by-guid-query.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/entity-count-query.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/entity-search-query.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/entity-storage-mutation.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/entity-storage-query.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/entity-title-table-row-cell.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/favorite-table-row-cell.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/grid-item.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/grid.mdx

This file was deleted.

8 changes: 0 additions & 8 deletions src/markdown-pages/components/heading-text.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions src/markdown-pages/components/heatmap-component.mdx

This file was deleted.

Loading

0 comments on commit 4f7f9aa

Please sign in to comment.