Skip to content

Commit

Permalink
chore: dont create pages for sdk data yet
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Sep 3, 2020
1 parent fc44f04 commit 78165cb
Showing 1 changed file with 16 additions and 50 deletions.
66 changes: 16 additions & 50 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {

const result = await graphql(`
{
allNewRelicSdkApi {
edges {
node {
fields {
slug
}
}
}
}
allNewRelicSdkComponent {
edges {
node {
fields {
slug
}
}
}
}
allMdx(limit: 1000) {
edges {
node {
Expand All @@ -59,21 +41,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
return;
}

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

allNewRelicSdkApi.edges.forEach(({ node }) => {
createPage({
path: node.fields.slug,
component: path.resolve('./src/templates/ApiReferenceTemplate.js'),
});
});

allNewRelicSdkComponent.edges.forEach(({ node }) => {
createPage({
path: node.fields.slug,
component: path.resolve('src/templates/ComponentReferenceTemplate.js'),
});
});
const { allMdx } = result.data;

allMdx.edges.forEach(({ node }) => {
const { frontmatter } = node;
Expand All @@ -89,23 +57,21 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
});
}

if (node.template !== 'ComponentReferenceTemplate') {
createPage({
path: frontmatter.path,
component: path.resolve(`src/templates/${frontmatter.template}.js`),
context: {
fileRelativePath: getFileRelativePath(node.fileAbsolutePath),
guidesFilter:
frontmatter.template === 'OverviewTemplate'
? `${frontmatter.path}/*`
: undefined,
relatedResourceLimit: Math.max(
MAX_RESULTS - (frontmatter.resources || []).length,
0
),
},
});
}
createPage({
path: frontmatter.path,
component: path.resolve(`src/templates/${frontmatter.template}.js`),
context: {
fileRelativePath: getFileRelativePath(node.fileAbsolutePath),
guidesFilter:
frontmatter.template === 'OverviewTemplate'
? `${frontmatter.path}/*`
: undefined,
relatedResourceLimit: Math.max(
MAX_RESULTS - (frontmatter.resources || []).length,
0
),
},
});
});
};

Expand Down

0 comments on commit 78165cb

Please sign in to comment.