File tree 2 files changed +27
-26
lines changed
2 files changed +27
-26
lines changed Original file line number Diff line number Diff line change 3
3
*
4
4
* See: https://www.gatsbyjs.org/ docs/ssr-apis/
5
5
*/
6
- const React = require ( "react" )
7
-
8
- const addTwitterTag = [
9
- < script >
10
- !function(e,t,n,s,u,a)
11
- { e . twq ||
12
- ( ( s = e . twq = function ( ) {
13
- s . exe ? s . exe . apply ( s , arguments ) : s . queue . push ( arguments ) ;
14
- } ) ,
15
- ( s . version = '1.1' ) ,
16
- ( s . queue = [ ] ) ,
17
- ( u = t . createElement ( n ) ) ,
18
- ( u . async = ! 0 ) ,
19
- ( u . src = '//static.ads-twitter.com/uwt.js' ) ,
20
- ( a = t . getElementsByTagName ( n ) [ 0 ] ) ,
21
- a . parentNode . insertBefore ( u , a ) ) }
22
- (window,document,'script'); // Insert Twitter Pixel ID and Standard Event
23
- data below twq('init','o73vi'); twq('track','PageView');
24
- </ script >
25
- ]
26
-
27
- export default onRenderBody = ( {
28
- setPostBodyComponents
29
- } ) => {
30
- setPostBodyComponents ( addTwitterTag )
31
- }
32
6
33
7
export { default as wrapPageElement } from './gatsby/wrap-page-element' ;
8
+ export { default as onRenderBody } from './gatsby/on-render-body' ;
Original file line number Diff line number Diff line change
1
+ const React = require ( 'react' ) ;
2
+
3
+ const onRenderBody = ( { setPostBodyComponents } ) => {
4
+ const addTwitterTag = (
5
+ < script >
6
+ !function(e,t,n,s,u,a)
7
+ { e . twq ||
8
+ ( ( s = e . twq = function ( ) {
9
+ s . exe ? s . exe . apply ( s , arguments ) : s . queue . push ( arguments ) ;
10
+ } ) ,
11
+ ( s . version = '1.1' ) ,
12
+ ( s . queue = [ ] ) ,
13
+ ( u = t . createElement ( n ) ) ,
14
+ ( u . async = ! 0 ) ,
15
+ ( u . src = '//static.ads-twitter.com/uwt.js' ) ,
16
+ ( a = t . getElementsByTagName ( n ) [ 0 ] ) ,
17
+ a . parentNode . insertBefore ( u , a ) ) }
18
+ (window,document,'script'); // Insert Twitter Pixel ID and Standard Event
19
+ data below twq('init','o73vi'); twq('track','PageView');
20
+ </ script >
21
+ ) ;
22
+
23
+ setPostBodyComponents ( [ addTwitterTag ] ) ;
24
+ } ;
25
+
26
+ export default onRenderBody ;
You can’t perform that action at this time.
0 commit comments