Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
feat: remove more unused plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
aswanson-nr committed Jan 26, 2022
1 parent b7e07e9 commit 769324d
Showing 1 changed file with 73 additions and 98 deletions.
171 changes: 73 additions & 98 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const quote = (str) => `"${str}"`;
const resolveQuickstartSlug = require("./src/utils/resolveQuickstartSlug");
const resolveQuickstartSlug = require('./src/utils/resolveQuickstartSlug');

module.exports = {
flags: {
Expand All @@ -8,47 +8,47 @@ module.exports = {
PRESERVE_FILE_DOWNLOAD_CACHE: true,
},
siteMetadata: {
title: "New Relic Developers",
titleTemplate: "%s | New Relic Developers",
title: 'New Relic Developers',
titleTemplate: '%s | New Relic Developers',
description:
"Do more on our platform and make New Relic your own with APIs, SDKs, code snippets, tutorials, and more developer tools.",
author: "New Relic",
repository: "https://github.com/newrelic/developer-website",
siteUrl: "https://developer.newrelic.com",
branch: "develop",
'Do more on our platform and make New Relic your own with APIs, SDKs, code snippets, tutorials, and more developer tools.',
author: 'New Relic',
repository: 'https://github.com/newrelic/developer-website',
siteUrl: 'https://developer.newrelic.com',
branch: 'develop',
},
plugins: [
"gatsby-plugin-sharp",
'gatsby-plugin-sharp',
{
resolve: "@newrelic/gatsby-theme-newrelic",
resolve: '@newrelic/gatsby-theme-newrelic',
options: {
oneTrustID: "77dd4d78-49db-4057-81ea-4bc325d6ecdd",
oneTrustID: '77dd4d78-49db-4057-81ea-4bc325d6ecdd',
forceTrailingSlashes: true,
layout: {
contentPadding: "2rem",
maxWidth: "1700px",
component: require.resolve("./src/layouts"),
mobileBreakpoint: "760px",
contentPadding: '2rem',
maxWidth: '1700px',
component: require.resolve('./src/layouts'),
mobileBreakpoint: '760px',
},
prism: {
languages: ["yaml", "sass", "scss", "java"],
languages: ['yaml', 'sass', 'scss', 'java'],
},
relatedResources: {
swiftype: {
resultsPath: `${__dirname}/src/data/related-pages.json`,
refetch: Boolean(process.env.BUILD_RELATED_CONTENT),
engineKey: "Ad9HfGjDw4GRkcmJjUut",
engineKey: 'Ad9HfGjDw4GRkcmJjUut',
limit: 5,
getSlug: ({ node }) => {
if (node.internal.type === "Mdx") {
if (node.internal.type === 'Mdx') {
return node.fields.slug;
} else if (node.internal.type === "Quickstarts") {
} else if (node.internal.type === 'Quickstarts') {
return resolveQuickstartSlug(node.name, node.id);
}
},
getParams: ({ node }) => {
let tags = [];
let title = "";
let title = '';
if (node.frontmatter) {
tags = node.frontmatter.tags;
title = node.frontmatter.title;
Expand All @@ -57,136 +57,111 @@ module.exports = {
title = node.title;
}
return {
q: tags ? tags.map(quote).join(" OR ") : title,
q: tags ? tags.map(quote).join(' OR ') : title,
search_fields: {
page: [
"tags^10",
"quick_start_name^8",
"body^5",
"title^1.5",
"*",
'tags^10',
'quick_start_name^8',
'body^5',
'title^1.5',
'*',
],
},
filters: {
page: {
type: ["docs", "developer", "opensource", "quickstarts"],
type: ['docs', 'developer', 'opensource', 'quickstarts'],
document_type: [
"!views_page_menu",
"!term_page_api_menu",
"!term_page_landing_page",
'!views_page_menu',
'!term_page_api_menu',
'!term_page_landing_page',
],
},
},
};
},
filter: ({ node }) =>
node.frontmatter?.template === "GuideTemplate" ||
node.internal.type === "Quickstarts",
node.frontmatter?.template === 'GuideTemplate' ||
node.internal.type === 'Quickstarts',
},
},
newrelic: {
configs: {
production: {
instrumentationType: "proAndSPA",
accountId: "10956800",
trustKey: "1",
agentID: "30712246",
licenseKey: "NRJS-649173eb1a7b28cd6ab",
applicationID: "30712246",
beacon: "staging-bam-cell.nr-data.net",
errorBeacon: "staging-bam-cell.nr-data.net",
instrumentationType: 'proAndSPA',
accountId: '10956800',
trustKey: '1',
agentID: '30712246',
licenseKey: 'NRJS-649173eb1a7b28cd6ab',
applicationID: '30712246',
beacon: 'staging-bam-cell.nr-data.net',
errorBeacon: 'staging-bam-cell.nr-data.net',
},
staging: {
instrumentationType: "proAndSPA",
accountId: "10956800",
trustKey: "1",
agentID: "30712246",
licenseKey: "NRJS-649173eb1a7b28cd6ab",
applicationID: "30712246",
beacon: "staging-bam-cell.nr-data.net",
errorBeacon: "staging-bam-cell.nr-data.net",
instrumentationType: 'proAndSPA',
accountId: '10956800',
trustKey: '1',
agentID: '30712246',
licenseKey: 'NRJS-649173eb1a7b28cd6ab',
applicationID: '30712246',
beacon: 'staging-bam-cell.nr-data.net',
errorBeacon: 'staging-bam-cell.nr-data.net',
},
},
},
tessen: {
tessenVersion: "1.14.0",
product: "DEV",
subproduct: "TDEV",
segmentWriteKey: "Ako0hclX8WGHwl9rm4n5uxLtT4wgEtuU",
tessenVersion: '1.14.0',
product: 'DEV',
subproduct: 'TDEV',
segmentWriteKey: 'Ako0hclX8WGHwl9rm4n5uxLtT4wgEtuU',
trackPageViews: true,
pageView: {
eventName: "pageView",
category: "DocPageView",
eventName: 'pageView',
category: 'DocPageView',
getProperties: ({ location, env }) => ({
path: location.pathname,
env: env === "production" ? "prod" : env,
env: env === 'production' ? 'prod' : env,
}),
},
},
},
},
"gatsby-plugin-sass",
'gatsby-plugin-sass',
{
resolve: "gatsby-plugin-manifest",
resolve: 'gatsby-plugin-manifest',
options: {
name: "gatsby-starter-default",
short_name: "starter",
start_url: "/",
background_color: "#663399",
theme_color: "#663399",
display: "minimal-ui",
icon: "src/images/favicon.png",
name: 'gatsby-starter-default',
short_name: 'starter',
start_url: '/',
background_color: '#663399',
theme_color: '#663399',
display: 'minimal-ui',
icon: 'src/images/favicon.png',
},
},
{
resolve: "gatsby-source-filesystem",
resolve: 'gatsby-source-filesystem',
options: {
name: "quickstarts",
name: 'quickstarts',
path: `${__dirname}/src/data/quickstarts.json`,
},
},
{
resolve: "gatsby-transformer-json",
resolve: 'gatsby-transformer-json',
options: {
// If we need to source json files other than the i18n/nav, we should
// consider making this dynamic. See the docs for ways to do this.
//
// https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-json
typeName: "Quickstarts",
typeName: 'Quickstarts',
},
},
// "gatsby-remark-images",
// "gatsby-transformer-remark",
'gatsby-plugin-mdx',
'gatsby-plugin-meta-redirect',
'gatsby-plugin-use-query-params',
{
resolve: "gatsby-plugin-mdx",
resolve: 'gatsby-plugin-gatsby-cloud',
options: {
// gatsbyRemarkPlugins: [
// {
// resolve: "gatsby-remark-images",
// options: {
// maxHeight: 400,
// maxWidth: 1200,
// fit: "inside",
// linkImagesToOriginal: false,
// },
// },
// {
// 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>',
// },
// },
// ],
},
},

"gatsby-plugin-meta-redirect",
"gatsby-plugin-use-query-params",
{
resolve: "gatsby-plugin-gatsby-cloud",
options: {
allPageHeaders: ["Referrer-Policy: no-referrer-when-downgrade"],
allPageHeaders: ['Referrer-Policy: no-referrer-when-downgrade'],
},
},
],
Expand Down

0 comments on commit 769324d

Please sign in to comment.