Skip to content

Commit

Permalink
build(package.json): Fix configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
hrenaud (NovaGaïa) committed Sep 22, 2022
1 parent 6bc2744 commit cb587dc
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 53 deletions.
46 changes: 0 additions & 46 deletions gatsby-ssr.js

This file was deleted.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
"main": "dist/rgpd-acceptance.js",
"module": "dist/rgpd-acceptance.js",
"files": [
"dist",
"gatsby-browser.js",
"gasby-node.js",
"gatsby-ssr.js"
"dist"
],
"scripts": {
"build": "babel src --out-dir ./dist --ignore \"**/__tests__\"",
Expand Down
6 changes: 3 additions & 3 deletions gatsby-browser.js → src/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*
* See: https://www.gatsbyjs.com/docs/browser-apis/
*/
import './src/styles/rgpd-acceptance.css'
import './styles/rgpd-acceptance.css'

import Banner from './src/components/Banner'
import Banner from './components/Banner'
import React from 'react'
import { initRGPDPlugins } from './src/utils/gb'
import { initRGPDPlugins } from './utils/gb'

export const onRouteUpdate = ({ location }, pluginOptions = {}) => {
initRGPDPlugins(`onRouteUpdate`, pluginOptions)
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions src/gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
*
* See: https://www.gatsbyjs.com/docs/ssr-apis/
*/
// You can delete this file if you're not using it

import React from 'react'

function buildInformationMessage() {
return (
<script
key="rgpd_message"
dangerouslySetInnerHTML={{
__html: `
console.log("La RGPD, c'est quoi ? https://www.economie.gouv.fr/entreprises/reglement-general-sur-protection-des-donnees-rgpd")
`,
}}
/>
)
}

export const onRenderBody = ({ setPostBodyComponents }) => {
setPostBodyComponents([buildInformationMessage()])
}

0 comments on commit cb587dc

Please sign in to comment.