Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.
Closed
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
7 changes: 0 additions & 7 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,3 @@ import "@fontsource/open-sans/600.css"
import "@fontsource/work-sans/400.css"
import "@fontsource/work-sans/500.css"
import "@fontsource/work-sans/600.css"

export const onRouteUpdate = () => {
if (typeof window.createPageviewTagForSPA === "function") {
window.createPageviewTagForSPA()
}
}

13 changes: 1 addition & 12 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const path = require(`path`)
const crypto = require(`crypto`)

const digitalData = require("./src/utils/digital-data")

const consts = {
githubRepoName: "galasa.dev",
Expand All @@ -23,14 +20,6 @@ const buildRepoSlug = process.env.PR_REPO_SLUG || process.env.BASE_REPO_SLUG ||
consts.buildRepoUrl = `https://github.com/${buildRepoSlug}`
consts.buildBranch = process.env.PR_BRANCH_NAME || process.env.BRANCH_NAME || "main"

function createHash(value) {
if (process.env.GATSBY_GALASA_ENV !== "LOCAL") {
return `'sha256-${crypto.createHash('sha256').update(value).digest('base64')}'`
} else {
return ''
}
}

const gatsbyRequiredRules = path.join(
process.cwd(),
"node_modules",
Expand Down Expand Up @@ -135,7 +124,7 @@ module.exports = {
mergeStyleHashes: false,
directives: {
"style-src": "'unsafe-inline' https://fonts.googleapis.com",
"script-src": `'self' 'unsafe-hashes' https://*.www.s81c.com https://*.ibm.com tags.tiqcdn.com consent.truste.com https://bat.bing.com https://scripts.demandbase.com https://www.googletagmanager.com https://pixel.mathtag.com https://*.tealiumiq.com https://consent.trustarc.com https://cdn.trackjs.com https://dpm.demdex.net https://www.google-analytics.com ${createHash(digitalData)}`,
"script-src": `'self' 'unsafe-hashes' https://*.www.s81c.com https://*.ibm.com tags.tiqcdn.com consent.truste.com https://bat.bing.com https://scripts.demandbase.com https://www.googletagmanager.com https://pixel.mathtag.com https://*.tealiumiq.com https://consent.trustarc.com https://cdn.trackjs.com https://dpm.demdex.net https://www.google-analytics.com`,
"font-src": "'self' data: https://fonts.gstatic.com https://*.www.s81c.com",
"connect-src": "'self' https://*.ibm.com https://dbdm-events.mybluemix.net https://*.algolia.net https://*.algolianet.com https://dpm.demdex.net https://*.tealiumiq.com https://api.company-target.com https://www.google-analytics.com https://stats.g.doubleclick.net",
"img-src": "'self' data: https://consent.trustarc.com https://consent-pref.trustarc.com https://bat.bing.com https://id.rlcdn.com https://www.google-analytics.com https://cm.everesttech.net https://pixel.mathtag.com https://dpm.demdex.net https://sync.crwdcntrl.net",
Expand Down
19 changes: 0 additions & 19 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,8 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
const React = require("react")

const { globalStyle } = require("./src/components/layout/layout.module.scss")
const digitalData = require("./src/utils/digital-data")


if (process.env.GATSBY_GALASA_ENV !== "LOCAL") {
console.log("Non-local build - adding tracking.")

exports.onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }, pluginOptions) => {

const totalComponents = getHeadComponents()
totalComponents.push(<script type="text/javascript" dangerouslySetInnerHTML={{
__html: digitalData
}}></script>)
totalComponents.push(<script src="https://1.www.s81c.com/common/stats/ibm-common.js" type="text/javascript" async></script>)
replaceHeadComponents(totalComponents)
}
} else {
console.log("Local build - no tracking.")
}

exports.onRenderBody = ({ setHtmlAttributes }) => {
setHtmlAttributes({ className: globalStyle })
Expand Down
8 changes: 0 additions & 8 deletions src/utils/digital-data.js

This file was deleted.