Skip to content

Commit

Permalink
Merge pull request #1059 from newrelic/jerel/upgrade-theme
Browse files Browse the repository at this point in the history
Upgrade theme
  • Loading branch information
jerelmiller authored Jan 15, 2021
2 parents c48e831 + 3b49536 commit a59c059
Show file tree
Hide file tree
Showing 23 changed files with 121 additions and 1,426 deletions.
20 changes: 0 additions & 20 deletions .babelrc

This file was deleted.

96 changes: 45 additions & 51 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const quote = (str) => `"${str}"`;
module.exports = {
siteMetadata: {
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',
Expand All @@ -19,6 +20,7 @@ module.exports = {
layout: {
contentPadding: '2rem',
maxWidth: '1700px',
component: require.resolve('./src/layouts'),
},
prism: {
languages: ['yaml', 'sass', 'scss', 'java'],
Expand All @@ -39,6 +41,49 @@ module.exports = {
},
},
},
swiftype: {
file: `${__dirname}/src/data/related-pages.json`,
refetch: Boolean(process.env.BUILD_RELATED_CONTENT),
engineKey: 'Ad9HfGjDw4GRkcmJjUut',
limit: 5,
getPath: ({ node }) => node.frontmatter.path,
getParams: ({ node }) => {
const {
tags,
title,
redirects = [],
resources = [],
} = node.frontmatter;

const filteredUrls = resources
.map((resource) => resource.url)
.concat(redirects);

return {
q: tags ? tags.map(quote).join(' OR ') : title,
search_fields: {
page: ['tags^10', 'body^5', 'title^1.5', '*'],
},
filters: {
page: {
type: ['!blog', '!forum'],
url: filteredUrls.map((url) =>
url.startsWith('/')
? `!https://developer.newrelic.com${url}`
: `!${url}`
),
document_type: [
'!views_page_menu',
'!term_page_api_menu',
'!term_page_landing_page',
],
},
},
};
},
filterNode: ({ node }) =>
node.frontmatter.template === 'GuideTemplate',
},
newrelic: {
configs: {
production: {
Expand All @@ -65,51 +110,6 @@ module.exports = {
},
},
},
{
resolve: 'gatsby-source-swiftype',
options: {
file: `${__dirname}/src/data/related-pages.json`,
refetch: Boolean(process.env.BUILD_RELATED_CONTENT),
engineKey: 'Ad9HfGjDw4GRkcmJjUut',
limit: 5,
getPath: ({ node }) => node.frontmatter.path,
getParams: ({ node }) => {
const {
tags,
title,
redirects = [],
resources = [],
} = node.frontmatter;

const filteredUrls = resources
.map((resource) => resource.url)
.concat(redirects);

return {
q: tags ? tags.map(quote).join(' OR ') : title,
search_fields: {
page: ['tags^10', 'body^5', 'title^1.5', '*'],
},
filters: {
page: {
type: ['!blog', '!forum'],
url: filteredUrls.map((url) =>
url.startsWith('/')
? `!https://developer.newrelic.com${url}`
: `!${url}`
),
document_type: [
'!views_page_menu',
'!term_page_api_menu',
'!term_page_landing_page',
],
},
},
};
},
filterNode: ({ node }) => node.frontmatter.template === 'GuideTemplate',
},
},
'gatsby-plugin-sass',
{
resolve: 'gatsby-plugin-manifest',
Expand All @@ -123,12 +123,6 @@ module.exports = {
icon: 'src/images/favicon.png',
},
},
{
resolve: `gatsby-plugin-layout`,
options: {
component: require.resolve('./src/layouts'),
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
"@emotion/styled": "^10.0.27",
"@mdx-js/mdx": "^1.6.19",
"@mdx-js/react": "^1.6.19",
"@newrelic/gatsby-theme-newrelic": "^1.18.1",
"@newrelic/gatsby-theme-newrelic": "^1.23.0",
"@splitsoftware/splitio-react": "^1.2.0",
"@xstate/react": "^1.1.0",
"@xstate/react": "^1.0.2",
"classnames": "^2.2.6",
"date-fns": "^2.16.1",
"diff": "^4.0.2",
"gatsby": "^2.24.91",
"gatsby-image": "^2.4.20",
"gatsby-plugin-emotion": "^4.3.14",
"gatsby-plugin-layout": "^1.3.12",
"gatsby-plugin-manifest": "^2.4.35",
"gatsby-plugin-mdx": "^1.4.0",
"gatsby-plugin-meta-redirect": "^1.1.1",
Expand Down Expand Up @@ -60,8 +59,6 @@
"@semantic-release/git": "^9.0.0",
"@testing-library/react": "^10.0.4",
"babel-jest": "^26.0.1",
"babel-plugin-prismjs": "^2.0.1",
"babel-preset-gatsby": "^0.4.2",
"core-js": "^2.4.0",
"eslint": "^7.11.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
Expand Down Expand Up @@ -100,7 +97,6 @@
"test": "jest",
"test:watch": "yarn test -- --watch",
"snyk-protect": "snyk protect",
"prepare": "yarn run snyk-protect",
"postinstall": "patch-package"
},
"husky": {
Expand Down
26 changes: 0 additions & 26 deletions src/@newrelic/gatsby-theme-newrelic/components/CodeBlock.js

This file was deleted.

26 changes: 0 additions & 26 deletions src/components/GithHubIcon.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/RelatedContentModules/Resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const Resources = ({ page }) => {

{!isDeveloperSite && (
<Icon
name={Icon.TYPE.EXTERNAL_LINK}
name="fe-external-link"
css={css`
margin-left: 0.25rem;
vertical-align: middle;
Expand Down
102 changes: 0 additions & 102 deletions src/components/Terminal/CommandLine.js

This file was deleted.

Loading

0 comments on commit a59c059

Please sign in to comment.