-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcustom.plugin.js
31 lines (31 loc) · 1.06 KB
/
custom.plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
export default async function myPlugin(context, opts) {
return {
name: "docusaurus-custom-plugin",
injectHtmlTags({ content }) {
return {
postBodyTags: [
`
<script type="text/javascript">
if (typeof window.atAsyncOptions !== 'object') window.atAsyncOptions = [];
var ids = ['286ff15c1b873aacf8de3968d93bdd8b'];
for (let id of ids) {
window.atAsyncOptions.push({
'key': id,
'format': 'js',
'async': true,
'container': 'atContainer-' + id,
'params': {}
});
console.log('//www.topcreativeformat.com/' + id + '/invoke.js');
var script = document.createElement('script');
script.type = "text/javascript";
script.async = true;
script.src = '//www.topcreativeformat.com/' + id + '/invoke.js';
document.getElementsByTagName('head')[0].appendChild(script);
}
</script>`,
],
};
},
};
}