-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70034c9
commit 76090f6
Showing
5 changed files
with
1,297 additions
and
3,237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,46 @@ | |
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const React = require('react'); | ||
|
||
exports.onRenderBody = ({ setHeadComponents, pathname }) => { | ||
console.log('pathname', pathname); | ||
console.log(pathname === 'fr/profiles' && 'coucou'); | ||
setHeadComponents([ | ||
exports.onRenderBody = ({ | ||
pathname, | ||
setPreBodyComponents, | ||
setPostBodyComponents | ||
}) => { | ||
const profilesRegex = new RegExp('profiles', 'g'); | ||
console.warn( | ||
"!!, Le path n'est généré que au PROD build sur Gatsby", | ||
'profilesRegex.test(pathname)', | ||
pathname, | ||
profilesRegex.test(pathname) | ||
); | ||
setPreBodyComponents([<div key={1} id={'root'} />]); | ||
setPostBodyComponents([ | ||
<script | ||
key={1} | ||
src="https://code.createjs.com/1.0.0/createjs.min.js" | ||
type="text/javascript" | ||
/>, | ||
<script key={1} src="/script/animation.js" type="text/javascript" /> | ||
<script key={2} src="/script/animation.js" type="text/javascript" />, | ||
<script | ||
key={3} | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" | ||
type="text/javascript" | ||
/>, | ||
<script | ||
key={4} | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/bundled.js" | ||
type="text/javascript" | ||
/>, | ||
<script | ||
key={5} | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/find.min.js" | ||
type="text/javascript" | ||
/>, | ||
<script key={6} src="/script/bulle-extension.js" type="text/javascript" />, | ||
<script | ||
key={7} | ||
src="/script/profiles/js/profiles.bundle.js" | ||
type="text/javascript" | ||
/> | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.