Skip to content

Commit

Permalink
feat: add segment to docuaurus (#2247)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachGoldberg authored Dec 12, 2024
1 parent df6fd6c commit 8d9c1ee
Show file tree
Hide file tree
Showing 3 changed files with 1,866 additions and 81 deletions.
34 changes: 22 additions & 12 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ const redirectPlugin = [
// @ts-ignore - types don't understand the plugin config
plugins.push(redirectPlugin)

const segmentPlugin = ["@twilio-labs/docusaurus-plugin-segment",
{
writeKey: "tVYixAoRAiTy0O7hBkB2TH2hMWFm0IW4",
allowedInDev: false,
}
];

// @ts-ignore - types don't understand the plugin config
plugins.push(segmentPlugin);

/** @type {import('@docusaurus/types').FasterConfig} */
const fasterConfig = {
rspackBundler: true,
Expand Down Expand Up @@ -213,8 +223,8 @@ const config = {
},
googleTagManager: enableGoogleAnalytics
? {
containerId: googleAnalyticsConfig.trackingID,
}
containerId: googleAnalyticsConfig.trackingID,
}
: undefined,
},
],
Expand Down Expand Up @@ -424,20 +434,20 @@ const config = {
},
algolia: algoliaConfig
? {
appId: algoliaConfig.appId,
// Public API key: safe to commit, but still sourced from config
apiKey: algoliaConfig.apiKey,
indexName: algoliaConfig.indexName,
libraryIndexName: algoliaConfig.libraryIndexName,
contextualSearch: true,
}
appId: algoliaConfig.appId,
// Public API key: safe to commit, but still sourced from config
apiKey: algoliaConfig.apiKey,
indexName: algoliaConfig.indexName,
libraryIndexName: algoliaConfig.libraryIndexName,
contextualSearch: true,
}
: undefined,
zoomSelector: ".markdown :not(em) > img:not(.no-zoom)",
posthog: enablePosthog
? {
apiKey: posthogConfig.apiKey,
appUrl: posthogConfig.appUrl,
}
apiKey: posthogConfig.apiKey,
appUrl: posthogConfig.appUrl,
}
: undefined,
metadata: [
// https://docusaurus.io/docs/2.x/seo#global-metadata
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@docusaurus/theme-mermaid": "^3.6.0",
"@mdx-js/react": "^3.0.1",
"@svgr/webpack": "^5.5.0",
"@twilio-labs/docusaurus-plugin-segment": "^0.1.0",
"@types/jest": "^27.4.0",
"algoliasearch": "^5.12.0",
"buffer": "^6.0.3",
Expand Down
Loading

0 comments on commit 8d9c1ee

Please sign in to comment.