Skip to content

Commit 82b1211

Browse files
authored
Merge pull request #58 from yjose/fix/fix_docs
remove offline plugin
2 parents fe61829 + 1f49bf8 commit 82b1211

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

docs/gatsby-browser.js

+15
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,18 @@
55
*/
66

77
// 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+
}

docs/gatsby-config.js

-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,5 @@ module.exports = {
6060
path: 'src/mdPages/'
6161
}
6262
},
63-
'gatsby-plugin-offline'
6463
]
6564
}

docs/src/components/common/Layout/Sidebar/index.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const Sidebar = ({ pages }) => {
3030
<div className="sidebar website-sidebar" key="SW">
3131
<div className="sticky-sidebar">
3232
<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>
3436
</div>
3537
3638
</div>

0 commit comments

Comments
 (0)