File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,27 @@ const addAliasPlugin = () => ({
19
19
} ) ;
20
20
21
21
/** @type {import('@docusaurus/types').PluginConfig } */
22
- const injectPlausiblePlugin = ( ) => ( {
23
- name : 'inject-plausible -plugin' ,
22
+ const injectHeadTagsPlugin = ( ) => ( {
23
+ name : 'inject-head-tags -plugin' ,
24
24
injectHtmlTags : ( ) => ( {
25
25
headTags : [
26
26
{
27
27
tagName : 'script' ,
28
28
attributes : {
29
- src : 'https://plausible.io/js/plausible .js' ,
29
+ src : 'https://plausible.io/js/script .js' ,
30
30
defer : true ,
31
31
'data-domain' : 'logto.io' ,
32
32
} ,
33
33
} ,
34
+ {
35
+ tagName : 'script' ,
36
+ innerHTML : `
37
+ window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) };
38
+ window.addEventListener('load', function() {
39
+ plausible('AnyPageView', { props: { source: 'Docs' } });
40
+ });
41
+ ` ,
42
+ } ,
34
43
{
35
44
tagName : 'meta' ,
36
45
attributes : {
@@ -181,7 +190,7 @@ const config = {
181
190
} ) ,
182
191
plugins : [
183
192
addAliasPlugin ,
184
- injectPlausiblePlugin ,
193
+ injectHeadTagsPlugin ,
185
194
'docusaurus-plugin-sass' ,
186
195
[
187
196
'@docusaurus/plugin-content-blog' ,
You can’t perform that action at this time.
0 commit comments