File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,15 @@ Google Analytics. This could be done with the following theme:
2121``` tsx
2222import { Application , DefaultTheme , PageEvent , JSX } from " typedoc" ;
2323
24+ const script = `
25+ (function() {
26+ var _owa = document.createElement('script'); _owa.type = 'text/javascript';
27+ _owa.async = true; _owa.src = '${site }' + '/modules/base/js/owa.tracker-combined-min.js';
28+ var _owa_s = document.getElementsByTagName('script')[0]; _owa_s.parentNode.insertBefore(_owa,
29+ _owa_s);
30+ }());
31+ ` .trim ();
32+
2433class MyThemeContext extends DefaultThemeRenderContext {
2534 // Important: If you use `this`, this function MUST be bound! Template functions are free
2635 // to destructure the context object to only grab what they care about.
@@ -30,15 +39,6 @@ class MyThemeContext extends DefaultThemeRenderContext {
3039
3140 const site = this .options .getValue (" gaId" );
3241
33- const script = `
34- (function() {
35- var _owa = document.createElement('script'); _owa.type = 'text/javascript';
36- _owa.async = true; _owa.src = '${site }' + '/modules/base/js/owa.tracker-combined-min.js';
37- var _owa_s = document.getElementsByTagName('script')[0]; _owa_s.parentNode.insertBefore(_owa,
38- _owa_s);
39- }());
40- ` .trim ();
41-
4242 return (
4343 <script >
4444 <JSX.Raw html = { script } />
You can’t perform that action at this time.
0 commit comments