Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export default defineConfig({
outline: { level: [2, 3] },
},
vite: {
// the PostHog variables on Vercel use the NEXT_PUBLIC_ prefix
envPrefix: ['VITE_', 'NEXT_PUBLIC_'],
server: { fs: { allow: ['..'] } },
ssr: { external: ['clipper-lib', 'svgo'] },
plugins: [
Expand Down
13 changes: 13 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,18 @@ export default {
app.component('IconGrid', IconGrid);
app.component('IconPage', IconPage);
app.component('HomeShowcase', HomeShowcase);

// Analytics: browser only, and only when a key is configured (so local dev and forks stay silent).
const key = import.meta.env.NEXT_PUBLIC_POSTHOG_KEY as string | undefined;
if (!import.meta.env.SSR && key) {
void import('posthog-js').then(({ default: posthog }) => {
posthog.init(key, {
api_host: (import.meta.env.NEXT_PUBLIC_POSTHOG_HOST as string | undefined) ?? 'https://eu.i.posthog.com',
// the `defaults` snapshot also turns on pageviews for client-side route changes
defaults: '2025-05-24',
person_profiles: 'identified_only',
});
});
}
},
} satisfies Theme;
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"preview": "vitepress preview"
},
"devDependencies": {
"posthog-js": "^1.434.0",
"svgo": "^4.1.0",
"vitepress": "^1.6.4",
"vitepress-plugin-llms": "1.14.0",
Expand Down
87 changes: 87 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading