diff --git a/.env.example b/.env.example index 94f5500..17b589f 100644 --- a/.env.example +++ b/.env.example @@ -12,3 +12,5 @@ ALGOLIA_INDEX_NAME=cslant ALGOLIA_SEARCH_PAGE_PATH=search GOOGLE_ANALYTICS_ID=G-57GJ9G7S4GB + +CLOUDFLARE_ANALYTICS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxx diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 6f28143..858e71d 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -78,6 +78,14 @@ const config: Config = { }, prism: PrismConfig, algolia: AlgoliaConfig, + + scripts: [ + { + src: 'https://static.cloudflareinsights.com/beacon.min.js', + async: true, + 'data-cf-beacon': `{"token": "${process.env.CLOUDFLARE_ANALYTICS_TOKEN}"}`, + }, + ], } satisfies Preset.ThemeConfig, plugins: [