File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1010 build :
1111 name : Build Docusaurus
1212 runs-on : ubuntu-latest
13+ env :
14+ GA_ID : ${{ secrets.GA_ID }}
1315 steps :
1416 - uses : actions/checkout@v4
1517 with :
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ import {themes as prismThemes} from 'prism-react-renderer';
22import type { Config } from '@docusaurus/types' ;
33import type * as Preset from '@docusaurus/preset-classic' ;
44
5+ // Access the environment variable
6+ const googleAnalyticsTrackingID = process . env . GA_ID ;
7+
58// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
69
710const config : Config = {
@@ -129,6 +132,12 @@ const config: Config = {
129132 theme : prismThemes . github ,
130133 darkTheme : prismThemes . dracula ,
131134 } ,
135+ gtag : googleAnalyticsTrackingID
136+ ? {
137+ trackingID : googleAnalyticsTrackingID ,
138+ anonymizeIP : true ,
139+ }
140+ : undefined ,
132141 } satisfies Preset . ThemeConfig ,
133142} ;
134143
You can’t perform that action at this time.
0 commit comments