diff --git a/gatsby-config.js b/gatsby-config.js index 37e8a9d9e7..589b488a6e 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,12 +1,12 @@ -const dotenv = require("dotenv") +const dotenv = require('dotenv'); // load environment specific configurations. dotenv.config({ path: `.env.${process.env.NODE_ENV}`, -}) -require("dotenv").config({ +}); +require('dotenv').config({ path: `.env.${process.env.NODE_ENV}`, -}) +}); // Gatsby Configuration, Options, and Plugins module.exports = { @@ -23,7 +23,7 @@ module.exports = { }, // Creates a shorthand for Contributor data in GraphQL mapping: { - "Mdx.frontmatter.contributors": "ContributorYaml", + 'Mdx.frontmatter.contributors': 'ContributorYaml', }, plugins: [ `gatsby-transformer-yaml`, @@ -32,17 +32,17 @@ module.exports = { // Handles inserting the GTM js blob into the site resolve: `gatsby-plugin-google-tagmanager`, options: { - id: "GTM-MDF545G", // process.env.GTM_ID_NEW, + id: 'GTM-MDF545G', // process.env.GTM_ID_NEW, //testing includeInDevelopment: false, defaultDataLayer: {}, }, }, { // Handles inserting the Segment js blob into the site - resolve: "gatsby-plugin-segment-js", + resolve: 'gatsby-plugin-segment-js', options: { - prodKey: "lEIpoQHx3G5Jqsy3GmjcPS357D4AlwlA", - devKey: "kDdX1dpmsAWuUn8zb1QDJR8YGbWJjKoj", + prodKey: 'lEIpoQHx3G5Jqsy3GmjcPS357D4AlwlA', + devKey: 'kDdX1dpmsAWuUn8zb1QDJR8YGbWJjKoj', trackPage: false, trackPageOnlyIfReady: true, customSnippet: @@ -119,7 +119,7 @@ module.exports = { }, }, // When running Gatsby develop, creates reporting pages - ...(process.env.NODE_ENV === "development" + ...(process.env.NODE_ENV === 'development' ? [ { resolve: `gatsby-plugin-page-creator`, @@ -148,19 +148,19 @@ module.exports = { // Allows for React components within the Markdown files. resolve: `gatsby-plugin-mdx`, // https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/ options: { - extensions: [".mdx", ".md"], + extensions: ['.mdx', '.md'], gatsbyRemarkPlugins: [ { // Allows for more complex tables - resolve: "gatsby-remark-grid-tables", // https://www.gatsbyjs.com/plugins/gatsby-remark-grid-tables/ + resolve: 'gatsby-remark-grid-tables', // https://www.gatsbyjs.com/plugins/gatsby-remark-grid-tables/ }, { // Required so the custom Youtube component can create iframes that work with Gatsby - resolve: "gatsby-remark-responsive-iframe", // https://www.gatsbyjs.com/plugins/gatsby-remark-responsive-iframe/ + resolve: 'gatsby-remark-responsive-iframe', // https://www.gatsbyjs.com/plugins/gatsby-remark-responsive-iframe/ }, { // Self-explanatory - resolve: "gatsby-remark-images", // https://www.gatsbyjs.com/plugins/gatsby-remark-images/ + resolve: 'gatsby-remark-images', // https://www.gatsbyjs.com/plugins/gatsby-remark-images/ options: { maxWidth: 1035, // sizeByPixelDensity: true, @@ -180,12 +180,12 @@ module.exports = { { resolve: `gatsby-remark-table-of-contents`, options: { - exclude: "Table of Contents", + exclude: 'Table of Contents', tight: true, ordered: false, fromHeading: 2, toHeading: 3, - className: "table-of-contents", + className: 'table-of-contents', }, }, { @@ -201,21 +201,21 @@ module.exports = { { resolve: `gatsby-remark-prismjs`, options: { - classPrefix: "language-", + classPrefix: 'language-', inlineCodeMarker: null, noInlineHighlight: true, aliases: {}, prompt: { - user: "user", - host: "localhost", + user: 'user', + host: 'localhost', }, }, }, { - resolve: "gatsby-remark-external-links", + resolve: 'gatsby-remark-external-links', options: { - target: "_blank", - rel: "nofollow noopener external", + target: '_blank', + rel: 'nofollow noopener external', }, }, ], @@ -225,7 +225,7 @@ module.exports = { `gatsby-plugin-sharp`, `gatsby-plugin-react-helmet`, { - resolve: "gatsby-plugin-sitemap", + resolve: 'gatsby-plugin-sitemap', }, { resolve: 'gatsby-plugin-feed', @@ -245,8 +245,11 @@ module.exports = { feeds: [ { serialize: ({ query: { site, allMdx } }) => { - return allMdx.edges.map(edge => { - const url = new URL(edge.node.fields.slug, site.siteMetadata.siteUrl).toString(); + return allMdx.edges.map((edge) => { + const url = new URL( + edge.node.fields.slug, + site.siteMetadata.siteUrl, + ).toString(); // Simple hash function to turn a string into a numeric value // https://chatgpt.com/share/69aeb001-e00f-41b9-98a4-816aa6a0330d function hashCode(str) { @@ -265,7 +268,9 @@ module.exports = { const hours = (hash % 24).toString().padStart(2, '0'); const minutes = (hash % 60).toString().padStart(2, '0'); - const seconds = ((hash >> 8) % 60).toString().padStart(2, '0'); // Shift for more variance + const seconds = ((hash >> 8) % 60) + .toString() + .padStart(2, '0'); // Shift for more variance return `${hours}:${minutes}:${seconds}`; } @@ -300,13 +305,14 @@ module.exports = { } } `, - output: "/release-notes/rss.xml", - title: "Pantheon release notes RSS feed", - description: 'Stay updated with the latest releases and enhancements.', - site_url: 'docs.pantheon.io/release-notes' + output: '/release-notes/rss.xml', + title: 'Pantheon release notes RSS feed', + description: + 'Stay updated with the latest releases and enhancements.', + site_url: 'docs.pantheon.io/release-notes', }, ], }, }, ], -} +};