Skip to content

Commit

Permalink
Apply Prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelwhitton committed Nov 7, 2024
1 parent adc5627 commit 9b5c382
Showing 1 changed file with 37 additions and 31 deletions.
68 changes: 37 additions & 31 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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`,
Expand All @@ -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:
Expand Down Expand Up @@ -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`,
Expand Down Expand Up @@ -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,
Expand All @@ -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',
},
},
{
Expand All @@ -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',
},
},
],
Expand All @@ -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',
Expand All @@ -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) {
Expand All @@ -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}`;
}
Expand Down Expand Up @@ -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',
},
],
},
},
],
}
};

0 comments on commit 9b5c382

Please sign in to comment.