Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redirects and remove pages #2286

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,13 @@ module.exports = {
{
resolve: `gatsby-remark-autolink-headers`,
options: {
icon: '<svg xmlns="http://www.w3.org/2000/svg" focusable="false" width="1rem" height="1rem" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg>',
icon:
'<svg xmlns="http://www.w3.org/2000/svg" focusable="false" width="1rem" height="1rem" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg>',
},
},
],
},
},
{
resolve: 'gatsby-source-newrelic-sdk',
options: {
release: 'release-3439',
},
},
'gatsby-plugin-embed-pages',
{
resolve: 'gatsby-plugin-gdpr-tracking',
Expand Down
66 changes: 1 addition & 65 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
}
}
}

allNewRelicSdkComponent {
edges {
node {
fields {
slug
}
}
}
}

allNewRelicSdkApi {
edges {
node {
fields {
slug
}
}
}
}
}
`);
// Handle errors
Expand All @@ -82,7 +62,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
return;
}

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

if (externalRedirects.length > 0) {
externalRedirects.forEach(({ url, paths }) => {
Expand Down Expand Up @@ -222,34 +202,6 @@ The 'path' property on frontmatter is deprecated and has no effect. URLs are now
},
});
});

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

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

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

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

exports.onCreatePage = async ({ page, actions }) => {
Expand Down Expand Up @@ -280,22 +232,6 @@ exports.onCreateNode = ({ node, getNode, actions }) => {
});
}

if (node.internal.type === 'NewRelicSdkComponent') {
createNodeField({
node,
name: 'slug',
value: `/components/${kebabCase(node.name)}`,
});
}

if (node.internal.type === 'NewRelicSdkApi') {
createNodeField({
node,
name: 'slug',
value: `/apis/${kebabCase(node.name)}`,
});
}

if (node.internal.type === 'Quickstarts') {
createNodeField({
node,
Expand Down
7 changes: 0 additions & 7 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ import wrapPageElement from './gatsby/wrap-page-element';

global.window = {
requestAnimationFrame: () => {},
__NR1_SDK__: {
default: {
PlatformStateContext: createContext(),
NerdletStateContext: createContext(),
ToastManager: () => null,
},
},
};

// This is needed to ensure the NR1 SDK can load properly
Expand Down
226 changes: 0 additions & 226 deletions plugins/gatsby-source-newrelic-sdk/gatsby-node.js

This file was deleted.

27 changes: 0 additions & 27 deletions plugins/gatsby-source-newrelic-sdk/gatsby-ssr.js

This file was deleted.

1 change: 0 additions & 1 deletion plugins/gatsby-source-newrelic-sdk/package.json

This file was deleted.

Loading
Loading