Skip to content

Commit

Permalink
feat: add manual cloudflare analytic
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Oct 31, 2024
1 parent 68d0bea commit 8a59997
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ ALGOLIA_INDEX_NAME=cslant
ALGOLIA_SEARCH_PAGE_PATH=search

GOOGLE_ANALYTICS_ID=G-57GJ9G7S4GB

CLOUDFLARE_ANALYTICS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxx
8 changes: 8 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit 8a59997

Please sign in to comment.