Skip to content

Commit

Permalink
[DOC-788][docs] add GA4 tag; make algolia and ga4 conditionally confi…
Browse files Browse the repository at this point in the history
…gured (#27369)

## Summary & Motivation

## How I Tested These Changes

## Changelog

NOCHANGELOG
  • Loading branch information
cmpadden authored Jan 24, 2025
1 parent f83a630 commit fe721fc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
31 changes: 16 additions & 15 deletions docs/docs-beta/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,16 @@ const config: Config = {
require.resolve('./src/plugins/scoutos'),
],
themeConfig: {
// Algolia environment variables are not required during development
algolia:
process.env.NODE_ENV === 'development'
? {
appId: 'ABC123',
apiKey: 'ABC123',
indexName: 'ABC123',
contextualSearch: false,
}
: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
contextualSearch: false,
},
...(process.env.ALGOLIA_APP_ID &&
process.env.ALGOLIA_API_KEY &&
process.env.ALGOLIA_INDEX_NAME && {
algolia: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
contextualSearch: false,
},
}),
announcementBar: {
id: 'announcementBar',
content: `<div><h3>Welcome to Dagster's new and improved documentation site!</h3> You can find the legacy documentation with content for versions 1.9.9 and earlier at <a target="_blank" href="https://legacy-docs.dagster.io/">legacy-docs.dagster.io</a>.</div>`,
Expand Down Expand Up @@ -192,6 +187,12 @@ const config: Config = {
return items;
},
},
...(process.env.GOOGLE_ANALYTICS_TRACKING_ID && {
gtag: {
trackingID: process.env.GOOGLE_ANALYTICS_TRACKING_ID,
anonymizeIP: true,
},
}),
} satisfies Preset.Options,
],
],
Expand Down
1 change: 1 addition & 0 deletions docs/docs-beta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"@docusaurus/core": "^3.7.0",
"@docusaurus/plugin-google-gtag": "^3.7.0",
"@docusaurus/plugin-ideal-image": "^3.7.0",
"@docusaurus/preset-classic": "^3.7.0",
"@docusaurus/theme-mermaid": "^3.7.0",
Expand Down
3 changes: 2 additions & 1 deletion docs/docs-beta/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3762,7 +3762,7 @@ __metadata:
languageName: node
linkType: hard

"@docusaurus/plugin-google-gtag@npm:3.7.0":
"@docusaurus/plugin-google-gtag@npm:3.7.0, @docusaurus/plugin-google-gtag@npm:^3.7.0":
version: 3.7.0
resolution: "@docusaurus/plugin-google-gtag@npm:3.7.0"
dependencies:
Expand Down Expand Up @@ -8375,6 +8375,7 @@ __metadata:
"@docusaurus/core": "npm:^3.7.0"
"@docusaurus/eslint-plugin": "npm:^3.7.0"
"@docusaurus/module-type-aliases": "npm:^3.7.0"
"@docusaurus/plugin-google-gtag": "npm:^3.7.0"
"@docusaurus/plugin-ideal-image": "npm:^3.7.0"
"@docusaurus/preset-classic": "npm:^3.7.0"
"@docusaurus/theme-classic": "npm:^3.7.0"
Expand Down

1 comment on commit fe721fc

@github-actions
Copy link

@github-actions github-actions bot commented on fe721fc Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagster-docs ready!

✅ Preview
https://dagster-docs-apiidj3uk-elementl.vercel.app

Built with commit fe721fc.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.