The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add webflow
Kiran K7d82a846af05
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/constants.ts b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/constants.tsindex 21257b3715..cae23a6bc7 100644--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/constants.ts+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/constants.ts@@ -7,7 +7,8 @@ export const guides: IntegrationGuide[] = [type: "no-code",key: "framer",title: "Framer",- description: "Dub Analytics",+ description: "How to add @dub/analytics to your Webflow site",+ shortDescription: "Dub Analytics",icon: Framer,recommended: true,},@@ -16,13 +17,15 @@ export const guides: IntegrationGuide[] = [key: "shopify",title: "Shopify",description: "Dub Analytics",+ shortDescription: "Dub Analytics",icon: Shopify,},{type: "no-code",key: "webflow",title: "Webflow",- description: "Dub Analytics",+ description: "How to add @dub/analytics to your Webflow site",+ shortDescription: "Dub Analytics",icon: Globe,},{@@ -30,6 +33,7 @@ export const guides: IntegrationGuide[] = [key: "wordpress",title: "WordPress",description: "Dub Analytics",+ shortDescription: "Dub Analytics",icon: Code,},];diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsxindex 08b02abe1f..dd32c55a66 100644--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx@@ -81,7 +81,7 @@ export function GuideList() {{guide.title}</div><div className="text-sm font-medium text-[#737373]">- {guide.description}+ {guide.shortDescription}</div></div></Link>diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsxindex f4beca1d89..fdf1d41c1a 100644--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx@@ -2,12 +2,12 @@import { onboardProgramAction } from "@/lib/actions/partners/onboard-program";import useWorkspace from "@/lib/swr/use-workspace";-import { Markdown } from "@/ui/shared/markdown";import { Button } from "@dub/ui";import { useAction } from "next-safe-action/hooks";import { useRouter } from "next/navigation";import { useState } from "react";import { toast } from "sonner";+import { Markdown } from "./markdown";import { IntegrationGuide } from "./types";interface GuideProps {@@ -45,6 +45,10 @@ export function Guide({ selectedGuide, markdown }: GuideProps) {const Icon = selectedGuide.icon;+ if (!markdown) {+ return null;+ }+return (<><hr className="mb-6 border-neutral-200" />@@ -60,27 +64,14 @@ export function Guide({ selectedGuide, markdown }: GuideProps) {/></div>- <h2 className="py-2 text-xl font-semibold leading-7 text-neutral-900">- Instructions for {selectedGuide.title}+ <h2 className="mt-6 text-xl font-semibold leading-7 text-neutral-900">+ {selectedGuide.description}</h2><div className="rounded-2xl bg-white p-0 py-6 shadow-none">- {/* Step 1 */}- <div className="mb-4">- <div className="mb-1 text-base font-bold">- Step 1: Install the Dub {selectedGuide.title} App- </div>- <div className="mb-6 text-neutral-600">- Ensure your program is connected to your website, so you can track- your clicks, leads, and sales on your program.- </div>- </div>-- <div className="mb-8 rounded-2xl bg-neutral-100">- {markdown && <Markdown className="p-6">{markdown}</Markdown>}- </div>+ <Markdown>{markdown}</Markdown>- <div className="flex flex-col gap-2">+ <div className="mt-10 flex flex-col gap-2"><Buttontext="I've completed this"className="w-full"diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/markdown.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/markdown.tsxnew file mode 100644index 0000000000..dc6898ad44--- /dev/null+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/markdown.tsx@@ -0,0 +1,54 @@+"use client";++import { cn } from "@dub/utils";+import ReactMarkdown from "react-markdown";+import remarkGfm from "remark-gfm";++export function Markdown({+ children,+ className,+ components,+}: {+ children: string;+ className?: string;+ components?: any;+}) {+ return (+ <ReactMarkdown+ className={cn(+ "prose prose-sm max-w-none transition-all",+ "prose-headings:font-semibold prose-headings:text-gray-900 prose-headings:border-b prose-headings:border-gray-200 prose-headings:pb-2",+ "prose-h1:text-2xl prose-h1:font-bold prose-h1:mt-8 prose-h1:mb-4",+ "prose-h2:text-xl prose-h2:font-semibold prose-h2:mt-6 prose-h2:mb-3",+ "prose-h3:text-lg prose-h3:font-semibold prose-h3:mt-4 prose-h3:mb-2",+ "prose-h4:text-base prose-h4:font-semibold prose-h4:mt-3 prose-h4:mb-1",+ "prose-p:text-gray-700 prose-p:leading-7 prose-p:mb-4",+ "prose-a:text-blue-600 prose-a:font-medium prose-a:underline prose-a:underline-offset-2 hover:prose-a:text-blue-800",+ "prose-strong:text-gray-900 prose-strong:font-semibold",+ "prose-em:text-gray-700 prose-em:italic",+ "prose-code:text-gray-800 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-mono",+ "prose-pre:bg-gray-50 prose-pre:border prose-pre:border-gray-200 prose-pre:rounded-lg prose-pre:p-4 prose-pre:overflow-x-auto",+ "prose-pre:code:bg-transparent prose-pre:code:p-0 prose-pre:code:text-sm",+ "prose-blockquote:border-l-4 prose-blockquote:border-gray-300 prose-blockquote:pl-4 prose-blockquote:italic prose-blockquote:text-gray-600",+ "prose-ul:list-disc prose-ul:pl-6 prose-ul:text-gray-700",+ "prose-ol:list-decimal prose-ol:pl-6 prose-ol:text-gray-700",+ "prose-li:mb-1",+ "prose-hr:border-gray-200 prose-hr:my-8",+ "prose-table:border-collapse prose-table:w-full",+ "prose-th:border prose-th:border-gray-300 prose-th:bg-gray-50 prose-th:px-3 prose-th:py-2 prose-th:text-left prose-th:font-semibold prose-th:text-gray-900",+ "prose-td:border prose-td:border-gray-300 prose-td:px-3 prose-td:py-2 prose-td:text-gray-700",+ "prose-img:rounded-lg prose-img:border prose-img:border-gray-200",+ className,+ )}+ components={{+ a: ({ node, ...props }) => (+ <a {...props} target="_blank" rel="noopener noreferrer" />+ ),+ ...components,+ }}+ remarkPlugins={[remarkGfm] as any}+ >+ {children}+ </ReactMarkdown>+ );+}diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/types.ts b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/types.tsindex be8e67e692..c008328631 100644--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/types.ts+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/types.ts@@ -4,7 +4,8 @@ export type IntegrationGuide = {type: IntegrationType;key: string;title: string;- description?: string;+ description: string;+ shortDescription: string;icon: any;recommended?: boolean;content?: string;diff --git a/apps/web/markdown/webflow.md b/apps/web/markdown/webflow.mdindex 1ff0532f38..e5378044b2 100644--- a/apps/web/markdown/webflow.md+++ b/apps/web/markdown/webflow.md@@ -1,22 +1,10 @@-# Webflow+Follow these steps to add `@dub/analytics` script to your Webflow site:-> How to add @dub/analytics to your Webflow site+- On your project's page, click on the **Webflow logo** in the left-hand side menu and choose **Project Settings**.-With `@dub/analytics`, you can track lead and sale conversions on your Webflow site, enabling you to measure the effectiveness of your marketing campaigns.+- Choose **[Custom Code](https://university.webflow.com/lesson/custom-code-in-the-head-and-body-tags?topics=site-settings)** from the menu and paste the Dub analytics script in the **Head Code** section.-You can add the `@dub/analytics` script to your Webflow website same way you would add Google Analytics script or any other JavaScript code.--Follow these steps to add the script to your site:--* On your project's page, click on the **Webflow logo** in the left-hand side menu and choose **Project Settings**.-* Choose **[Custom Code](https://university.webflow.com/lesson/custom-code-in-the-head-and-body-tags?topics=site-settings)** from the menu and paste the Dub analytics script in the **Head Code** section.-* Click on the **Save Changes** button and then **Publish** your changes.--```html-<script src="https://www.dubcdn.com/analytics/script.js" defer></script>-```--If you're using [Dub Partners](/partners/quickstart) for affiliate management, you will also need to set up the `data-domains` property to enable [client-side click-tracking](/sdks/client-side/features/client-side-click-tracking).+- Click on the **Save Changes** button and then **Publish** your changes.```html<script@@ -26,4 +14,4 @@ If you're using [Dub Partners](/partners/quickstart) for affiliate management, y></script>```-Read the [client-side click-tracking guide](/sdks/client-side/features/client-side-click-tracking) for more information.+Read the [client-side click-tracking guide](https://dub.co/docs/sdks/client-side/features/client-side-click-tracking) for more information.