Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Display integration logos

Blue Mousebe849ca73ffc
diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx
index ba565d94a..52c78e3ca 100644
--- a/docs/app/layout.tsx
+++ b/docs/app/layout.tsx
@@ -2,6 +2,7 @@ import { RootProvider } from "fumadocs-ui/provider/next";
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import { GithubInfo } from "fumadocs-ui/components/github-info";
import type { ReactNode } from "react";
+import { addIntegrationLogos } from "@/components/IntegrationLogo";
import { source } from "@/lib/source";
import Footer from "./components/Footer";
import Analytics from "./components/Analytics";
@@ -37,7 +38,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
<body>
<RootProvider search={{ options: { api: "/docs/api/search" } }}>
<DocsLayout
- tree={source.getPageTree()}
+ tree={addIntegrationLogos(source.getPageTree())}
nav={{
title: (
<div className="flex -translate-y-[2px] items-center gap-2 select-none">
diff --git a/docs/components/IntegrationLogo.tsx b/docs/components/IntegrationLogo.tsx
new file mode 100644
index 000000000..f3070f5f3
--- /dev/null
+++ b/docs/components/IntegrationLogo.tsx
@@ -0,0 +1,188 @@
+import type { Item, Node, Root } from "fumadocs-core/page-tree";
+import type { ComponentType, CSSProperties } from "react";
+import {
+ siAngular,
+ siAstro,
+ siBigcommerce,
+ siCarrd,
+ siDjango,
+ siDocusaurus,
+ siDotnet,
+ siDrupal,
+ siEleventy,
+ siExpress,
+ siFastapi,
+ siFastify,
+ siFlask,
+ siFramer,
+ siGatsby,
+ siGhost,
+ siGitbook,
+ siGoogletagmanager,
+ siHexo,
+ siHtmx,
+ siHugo,
+ siJekyll,
+ siJoomla,
+ siLaravel,
+ siMaterialformkdocs,
+ siNestjs,
+ siNextdotjs,
+ siNextra,
+ siNuxt,
+ siPreact,
+ siPrestashop,
+ siQwik,
+ siReact,
+ siRemix,
+ siRubyonrails,
+ siShopify,
+ siSolid,
+ siSquarespace,
+ siSvelte,
+ siTildapublishing,
+ siVitepress,
+ siVuedotjs,
+ siWebflow,
+ siWix,
+ siWoocommerce,
+ siWordpress,
+ type SimpleIcon,
+} from "simple-icons";
+import GoogleGIcon from "./GoogleGIcon";
+
+type LogoDefinition =
+ | { icon: SimpleIcon }
+ | { component: ComponentType<{ className?: string }> }
+ | { monogram: string; color: string };
+
+const LOGOS_BY_URL: Record<string, LogoDefinition> = {
+ "/angular-integration": { icon: siAngular },
+ "/aspnet-integration": { icon: siDotnet },
+ "/astro-integration": { icon: siAstro },
+ "/bigcommerce-integration": { icon: siBigcommerce },
+ "/bubble-integration": { monogram: "B", color: "#6C5CE7" },
+ "/carrd-integration": { icon: siCarrd },
+ "/docusaurus-integration": { icon: siDocusaurus },
+ "/drupal-integration": { icon: siDrupal },
+ "/eleventy-integration": { icon: siEleventy },
+ "/express-integration": { icon: siExpress },
+ "/fastify-integration": { icon: siFastify },
+ "/framer-integration": { icon: siFramer },
+ "/ghost-integration": { icon: siGhost },
+ "/gitbook-integration": { icon: siGitbook },
+ "/integrations/google-search-console": { component: GoogleGIcon },
+ "/gtm-integration": { icon: siGoogletagmanager },
+ "/hexo-integration": { icon: siHexo },
+ "/htmx-integration": { icon: siHtmx },
+ "/hugo-integration": { icon: siHugo },
+ "/jekyll-integration": { icon: siJekyll },
+ "/joomla-integration": { icon: siJoomla },
+ "/laravel-integration": { icon: siLaravel },
+ "/mkdocs-integration": { icon: siMaterialformkdocs },
+ "/nestjs-integration": { icon: siNestjs },
+ "/prestashop-integration": { icon: siPrestashop },
+ "/django-integration": { icon: siDjango },
+ "/fastapi-integration": { icon: siFastapi },
+ "/flask-integration": { icon: siFlask },
+ "/qwik-integration": { icon: siQwik },
+ "/gatsby-integration": { icon: siGatsby },
+ "/nextjs-integration": { icon: siNextdotjs },
+ "/nextra-integration": { icon: siNextra },
+ "/preact-integration": { icon: siPreact },
+ "/react-integration": { icon: siReact },
+ "/remix-integration": { icon: siRemix },
+ "/ruby-on-rails-integration": { icon: siRubyonrails },
+ "/shopify-integration": { icon: siShopify },
+ "/solidjs-integration": { icon: siSolid },
+ "/squarespace-integration": { icon: siSquarespace },
+ "/sveltekit-integration": { icon: siSvelte },
+ "/thrivecart-integration": { monogram: "TC", color: "#1E73EA" },
+ "/tilda-integration": { icon: siTildapublishing },
+ "/nuxt-integration": { icon: siNuxt },
+ "/vitepress-integration": { icon: siVitepress },
+ "/vue-integration": { icon: siVuedotjs },
+ "/webflow-integration": { icon: siWebflow },
+ "/weebly-integration": { monogram: "W", color: "#2990EA" },
+ "/wix-integration": { icon: siWix },
+ "/woocommerce-integration": { icon: siWoocommerce },
+ "/wordpress-integration": { icon: siWordpress },
+};
+
+export const INTEGRATION_COUNT = Object.keys(LOGOS_BY_URL).length;
+
+const classes = (...values: (string | false | undefined)[]) => values.filter(Boolean).join(" ");
+
+const hasDarkBrandColor = (hex: string) => {
+ const [red, green, blue] = hex.match(/.{2}/g)?.map((value) => Number.parseInt(value, 16)) ?? [];
+ return red * 0.299 + green * 0.587 + blue * 0.114 < 70;
+};
+
+export function IntegrationLogo({ href, className }: { href: string; className?: string }) {
+ const logo = LOGOS_BY_URL[href];
+ if (!logo) return null;
+
+ if ("component" in logo) {
+ return <logo.component className={className} />;
+ }
+
+ if ("monogram" in logo) {
+ return (
+ <svg viewBox="0 0 24 24" className={className} aria-hidden="true">
+ <rect width="24" height="24" rx="6" fill={logo.color} />
+ <text
+ x="12"
+ y="12.5"
+ fill="white"
+ dominantBaseline="central"
+ textAnchor="middle"
+ fontFamily="ui-sans-serif, system-ui, sans-serif"
+ fontSize={logo.monogram.length > 1 ? 8 : 12}
+ fontWeight="700"
+ >
+ {logo.monogram}
+ </text>
+ </svg>
+ );
+ }
+
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ className={classes(
+ "text-(--integration-logo-color)",
+ hasDarkBrandColor(logo.icon.hex) && "dark:text-white",
+ className,
+ )}
+ style={{ "--integration-logo-color": `#${logo.icon.hex}` } as CSSProperties}
+ aria-hidden="true"
+ >
+ <path fill="currentColor" d={logo.icon.path} />
+ </svg>
+ );
+}
+
+const addLogoToNode = (node: Node): Node => {
+ if (node.type === "page") {
+ if (!LOGOS_BY_URL[node.url]) return node;
+ return { ...node, icon: <IntegrationLogo href={node.url} /> };
+ }
+
+ if (node.type === "folder") {
+ return {
+ ...node,
+ children: node.children.map(addLogoToNode),
+ index: node.index ? (addLogoToNode(node.index) as Item) : undefined,
+ };
+ }
+
+ return node;
+};
+
+export function addIntegrationLogos(tree: Root): Root {
+ return {
+ ...tree,
+ children: tree.children.map(addLogoToNode),
+ fallback: tree.fallback ? addIntegrationLogos(tree.fallback) : undefined,
+ };
+}
diff --git a/docs/components/IntegrationsGrid.tsx b/docs/components/IntegrationsGrid.tsx
index 89740373b..c32b60910 100644
--- a/docs/components/IntegrationsGrid.tsx
+++ b/docs/components/IntegrationsGrid.tsx
@@ -2,248 +2,143 @@
import { ArrowRightIcon } from "@phosphor-icons/react";
import { Cards, Card } from "fumadocs-ui/components/card";
-import type { ComponentType } from "react";
-import {
- siAngular,
- siAstro,
- siBigcommerce,
- siCarrd,
- siDjango,
- siDocusaurus,
- siDrupal,
- siFlask,
- siFramer,
- siGatsby,
- siGhost,
- siGoogletagmanager,
- siHugo,
- siJekyll,
- siLaravel,
- siNextdotjs,
- siNuxt,
- siReact,
- siRemix,
- siRubyonrails,
- siShopify,
- siSquarespace,
- siSvelte,
- siVuedotjs,
- siWebflow,
- siWix,
- siWoocommerce,
- siWordpress,
- type SimpleIcon,
-} from "simple-icons";
-import GoogleGIcon from "./GoogleGIcon";
-
-const cn = (...classes: (string | undefined | null | false)[]) => classes.filter(Boolean).join(" ");
+import { INTEGRATION_COUNT, IntegrationLogo } from "./IntegrationLogo";
const INTEGRATIONS: {
name: string;
href: string;
- icon?: SimpleIcon;
- customIcon?: ComponentType<{ className?: string }>;
- iconClassName?: string;
}[] = [
{
name: "Angular",
href: "/angular-integration",
- icon: siAngular,
- iconClassName: "text-[#DD0031]",
},
{
name: "Astro",
href: "/astro-integration",
- icon: siAstro,
},
{
name: "BigCommerce",
href: "/bigcommerce-integration",
- icon: siBigcommerce,
- iconClassName: "dark:text-white",
},
{
name: "Carrd",
href: "/carrd-integration",
- icon: siCarrd,
},
{
name: "Django",
href: "/django-integration",
- icon: siDjango,
- iconClassName: "dark:text-[#44B78B]",
},
{
name: "Docusaurus",
href: "/docusaurus-integration",
- icon: siDocusaurus,
},
{
name: "Drupal",
href: "/drupal-integration",
- icon: siDrupal,
},
{
name: "Flask",
href: "/flask-integration",
- icon: siFlask,
},
{
name: "Framer",
href: "/framer-integration",
- icon: siFramer,
},
{
name: "Gatsby",
href: "/gatsby-integration",
- icon: siGatsby,
},
{
name: "Ghost",
href: "/ghost-integration",
- icon: siGhost,
- iconClassName: "dark:text-white",
},
{
name: "Search Console",
href: "/integrations/google-search-console",
- customIcon: GoogleGIcon,
},
{
name: "GTM",
href: "/gtm-integration",
- icon: siGoogletagmanager,
},
{
name: "Hugo",
href: "/hugo-integration",
- icon: siHugo,
},
{
name: "Jekyll",
href: "/jekyll-integration",
- icon: siJekyll,
},
{
name: "Laravel",
href: "/laravel-integration",
- icon: siLaravel,
},
{
name: "Next.js",
href: "/nextjs-integration",
- icon: siNextdotjs,
- iconClassName: "dark:text-white",
},
{
name: "Nuxt",
href: "/nuxt-integration",
- icon: siNuxt,
},
{
name: "React",
href: "/react-integration",
- icon: siReact,
},
{
name: "Remix",
href: "/remix-integration",
- icon: siRemix,
- iconClassName: "dark:text-white",
},
{
name: "Ruby on Rails",
href: "/ruby-on-rails-integration",
- icon: siRubyonrails,
},
{
name: "Shopify",
href: "/shopify-integration",
- icon: siShopify,
},
{
name: "Squarespace",
href: "/squarespace-integration",
- icon: siSquarespace,
- iconClassName: "dark:text-white",
},
{
name: "SvelteKit",
href: "/sveltekit-integration",
- icon: siSvelte,
},
{
name: "Vue",
href: "/vue-integration",
- icon: siVuedotjs,
},
{
name: "Webflow",
href: "/webflow-integration",
- icon: siWebflow,
},
{
name: "Wix",
href: "/wix-integration",
- icon: siWix,
},
{
name: "WooCommerce",
href: "/woocommerce-integration",
- icon: siWoocommerce,
},
{
name: "WordPress",
href: "/wordpress-integration",
- icon: siWordpress,
},
];
-const TOTAL_INTEGRATION_GUIDES = 50;
-
-const IntegrationLogo = ({
- icon,
- className,
- style,
-}: {
- icon: SimpleIcon;
- className?: string;
- style?: React.CSSProperties;
-}) => (
- <svg viewBox="0 0 24 24" className={className} style={style} aria-hidden="true">
- <path fill="currentColor" d={icon.path} />
- </svg>
-);
-
export function IntegrationsGrid() {
- const moreIntegrationsCount = Math.max(TOTAL_INTEGRATION_GUIDES - INTEGRATIONS.length, 0);
+ const moreIntegrationsCount = Math.max(INTEGRATION_COUNT - INTEGRATIONS.length, 0);
return (
<Cards className="sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5">
- {INTEGRATIONS.map((integration) => {
- const icon = integration.customIcon ? (
- <integration.customIcon className={cn(integration.iconClassName)} />
- ) : integration.icon ? (
- <IntegrationLogo
- icon={integration.icon}
- className={cn("text-(--brand-color)", integration.iconClassName)}
- style={
- {
- "--brand-color": `#${integration.icon.hex}`,
- } as React.CSSProperties
- }
- />
- ) : undefined;
-
- return (
- <Card
- key={integration.name}
- href={integration.href}
- title={integration.name}
- icon={icon}
- />
- );
- })}
+ {INTEGRATIONS.map((integration) => (
+ <Card
+ key={integration.name}
+ href={integration.href}
+ title={integration.name}
+ icon={<IntegrationLogo href={integration.href} />}
+ />
+ ))}
<Card
href="/integrations"
title={`+${moreIntegrationsCount} more`}