File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
7
7
// You can delete this file if you're not using it
8
+
9
+ let firstRender = true ;
10
+ exports . onRouteUpdate = ( { location } ) => {
11
+ if ( firstRender ) firstRender = false
12
+ else {
13
+ const carbon_container = document . getElementById ( 'carbon_container' ) ;
14
+ carbon_container . innerHTML = ''
15
+ const script = document . createElement ( 'script' ) ;
16
+ script . setAttribute ( 'async' , '' ) ;
17
+ script . setAttribute ( 'type' , 'text/javascript' ) ;
18
+ script . setAttribute ( 'src' , '//cdn.carbonads.com/carbon.js?serve=CK7D52QE&placement=react-popupelazizicom' ) ;
19
+ script . setAttribute ( 'id' , '_carbonads_js' ) ;
20
+ carbon_container . appendChild ( script ) ;
21
+ }
22
+ }
Original file line number Diff line number Diff line change @@ -60,6 +60,5 @@ module.exports = {
60
60
path : 'src/mdPages/'
61
61
}
62
62
} ,
63
- 'gatsby-plugin-offline'
64
63
]
65
64
}
Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ const Sidebar = ({ pages }) => {
30
30
< div className = "sidebar website-sidebar" key = "SW" >
31
31
< div className = "sticky-sidebar" >
32
32
< Menu routes = { routes } />
33
- < script async type = "text/javascript" src = "//cdn.carbonads.com/carbon.js?serve=CK7D52QE&placement=react-popupelazizicom" id="_carbonads_js" />
33
+ < div id = "carbon_container" >
34
+ < script async type = "text/javascript" src = "//cdn.carbonads.com/carbon.js?serve=CK7D52QE&placement=react-popupelazizicom" id="_carbonads_js" />
35
+ </div>
34
36
</div>
35
37
36
38
</div>
You can’t perform that action at this time.
0 commit comments