The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
standardize FEATURES_LIST
Steven Tey8b9cdd2dc75b
diff --git a/app/dub.co/features/[slug]/page.tsx b/app/dub.co/features/[slug]/page.tsxindex 33a7573a40..f5ec02d2d5 100644--- a/app/dub.co/features/[slug]/page.tsx+++ b/app/dub.co/features/[slug]/page.tsx@@ -1,9 +1,11 @@-import { APP_DOMAIN } from "#/lib/constants";-import { features } from "#/lib/constants/content";+import { APP_DOMAIN, DUB_THUMBNAIL } from "#/lib/constants";+import { FEATURES_LIST } from "#/lib/constants/content";import { constructMetadata } from "#/lib/utils";+import BlurImage from "#/ui/blur-image";import CTA from "#/ui/home/cta";import Logos from "#/ui/home/logos";-import { Github } from "@/components/shared/icons";+import MaxWidthWrapper from "@/components/shared/max-width-wrapper";+import { PlayCircle } from "lucide-react";import { notFound } from "next/navigation";export function generateMetadata({@@ -13,12 +15,12 @@ export function generateMetadata({slug: string;};}) {- const data = features.find(({ slug }) => slug === params.slug);+ const data = FEATURES_LIST.find(({ slug }) => slug === params.slug);if (!data) {return;}return constructMetadata({- title: `${data.seoTitle || data.title} – Dub`,+ title: `${data.title} – Dub`,});}@@ -29,20 +31,17 @@ export default function FeaturePage({slug: string;};}) {- const data = features.find(({ slug }) => slug === params.slug);+ const data = FEATURES_LIST.find(({ slug }) => slug === params.slug);if (!data) {notFound();}return (<>- <div className="mx-auto mb-10 mt-12 max-w-md px-2.5 text-center sm:max-w-lg sm:px-0">- <h1 className="mt-5 font-display text-4xl font-extrabold leading-[1.15] text-black sm:text-6xl sm:leading-[1.15]">+ <div className="mx-auto mt-12 max-w-md px-2.5 text-center sm:max-w-lg sm:px-0">+ <h1 className="mt-5 font-display text-3xl font-extrabold leading-[1.15] text-black sm:text-5xl sm:leading-[1.15]">{data.title}</h1>- <h2 className="mt-5 text-gray-600 sm:text-xl">- Dub is an open-source link management tool for modern marketing teams- to create, share, and track short links.- </h2>+ <h2 className="mt-5 text-gray-600 sm:text-xl">{data.description}</h2><div className="mx-auto mt-10 flex max-w-fit space-x-4"><a@@ -57,12 +56,23 @@ export default function FeaturePage({target="_blank"rel="noreferrer">- <Github className="h-5 w-5 text-black" />- <p className="text-sm">Star on GitHub</p>+ <PlayCircle className="h-5 w-5 text-gray-400" />+ <p className="text-sm">Watch Demo</p></a></div></div>- <Logos />+ <MaxWidthWrapper className="mt-10">+ <BlurImage+ src={data.thumbnail || DUB_THUMBNAIL}+ alt={data.title}+ className="mx-auto rounded-t-lg border border-b-0 border-gray-200"+ width={1735}+ height={990}+ />+ </MaxWidthWrapper>+ <div className="border-y border-gray-200 bg-white/10 py-8 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur">+ <Logos />+ </div><CTA /></>);diff --git a/app/sitemap.ts b/app/sitemap.tsindex 43d5684461..16090baab4 100644--- a/app/sitemap.ts+++ b/app/sitemap.ts@@ -7,7 +7,11 @@ import {allLegalPosts,} from "contentlayer/generated";import { isHomeHostname, allTools } from "#/lib/constants";-import { BLOG_CATEGORIES, HELP_CATEGORIES } from "#/lib/constants/content";+import {+ BLOG_CATEGORIES,+ HELP_CATEGORIES,+ FEATURES_LIST,+} from "#/lib/constants/content";export default async function Sitemap() {const headersList = headers();@@ -40,6 +44,10 @@ export default async function Sitemap() {url: `https://${domain}/pricing`,lastModified: new Date(),},+ ...FEATURES_LIST.map((feature) => ({+ url: `https://${domain}/features/${feature.slug}`,+ lastModified: new Date(),+ })),{url: `https://${domain}/blog`,lastModified: new Date(),diff --git a/app/ui/home/demo.tsx b/app/ui/home/demo.tsxindex 23237ab017..3fe16e63b0 100644--- a/app/ui/home/demo.tsx+++ b/app/ui/home/demo.tsx@@ -19,7 +19,7 @@ export default function Demo() {const [showDefaultLink, setShowDefaultLink] = useState(true);return (- <div className="mx-auto w-full max-w-md px-2.5 sm:px-0">+ <div className="mx-auto mb-5 w-full max-w-md px-2.5 sm:px-0"><formref={formRef}onSubmit={(e) => {diff --git a/app/ui/home/faq.tsx b/app/ui/home/faq.tsxindex 6f558e869a..3a1633dfcc 100644--- a/app/ui/home/faq.tsx+++ b/app/ui/home/faq.tsx@@ -30,7 +30,7 @@ const faqs = [export default function FAQ() {return (- <div className="mt-20 border-t border-gray-200 bg-white/10 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur">+ <div className="mt-10 border-t border-gray-200 bg-white/10 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur"><MaxWidthWrapper className="my-20"><div className="grid grid-cols-1 gap-5 md:grid-cols-3"><div className="p-3">diff --git a/app/ui/home/features.tsx b/app/ui/home/features.tsxindex b39732a1ac..669403684f 100644--- a/app/ui/home/features.tsx+++ b/app/ui/home/features.tsx@@ -1,7 +1,6 @@"use client";import Link from "next/link";-import { Airplay, Chart, Users, Photo } from "@/components/shared/icons";import MaxWidthWrapper from "@/components/shared/max-width-wrapper";import { useState } from "react";import {@@ -11,121 +10,13 @@ import {AccordionTrigger,} from "#/ui/accordion";import { AnimatePresence, motion } from "framer-motion";-import { useLinkQRModal } from "#/ui/modals/link-qr-modal";-import { DEFAULT_LINK_PROPS } from "#/lib/constants";-import { useAddEditLinkModal } from "#/ui/modals/add-edit-link-modal";-import { Link2, QrCode } from "lucide-react";--const featureList = [- {- key: "analytics",- title: "Analytics that matter",- icon: <Chart className="h-5 w-5 text-gray-600" />,- description:- "Dub provides powerful analytics for your links, including geolocation, device, browser, and referrer information.",- cta: (- <Link- href="/stats/github"- className="block max-w-fit rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"- >- View demo- </Link>- ),- demo: "https://d2vwwcvoksz7ty.cloudfront.net/analytics.mp4",- thumbnail: "/_static/features/analytics.png",- },- {- key: "domains",- title: "Use your own domain",- icon: <Airplay className="h-5 w-5 text-gray-600" />,- description:- "Dub offers free custom domains on all plans - start personalizing your links today.",- cta: (- <a- href="/help/article/how-to-add-custom-domain"- target="_blank"- className="block max-w-fit rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"- >- Learn more- </a>- ),- demo: "https://d2vwwcvoksz7ty.cloudfront.net/custom-domain.mp4",- },- {- key: "link",- title: "Powerful link builder",- icon: <Link2 className="h-5 w-5 text-gray-600" />,- description:- "Build your links with UTM parameters, password protection, expiration dates, iOS/Android targeting, etc.",- cta: "View demo", //custom cta- demo: "https://d2vwwcvoksz7ty.cloudfront.net/link.mp4",- },- {- key: "social",- title: "Custom social media cards",- icon: <Photo className="h-5 w-5 text-gray-600" />,- description:- "Overlay custom OG images on your links to make them stand out on social media.",- cta: (- <a- href="/help/article/how-to-create-link#custom-social-media-cards"- target="_blank"- className="block max-w-fit rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"- >- Learn more- </a>- ),- demo: "https://d2vwwcvoksz7ty.cloudfront.net/og.mp4",- },- {- key: "qr",- title: "Free QR code generator",- icon: <QrCode className="h-5 w-5 text-gray-600" />,- description:- "QR codes and short links are like peas in a pod. That's why we've built a QR code generator right into Dub.",- cta: "View demo", //custom cta- demo: "https://d2vwwcvoksz7ty.cloudfront.net/qr.mp4",- },- {- key: "team",- title: "Collaborate with your team",- icon: <Users className="h-5 w-5 text-gray-600" />,- description:- "With Dub, you can invite your teammates to collaborate on your project for free - no more sharing logins via Google groups.",- cta: (- <a- href="/help/article/how-to-invite-teammates"- target="_blank"- className="block max-w-fit rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"- >- Learn more- </a>- ),- demo: "https://d2vwwcvoksz7ty.cloudfront.net/team.mp4",- },-];+import { FEATURES_LIST } from "#/lib/constants/content";+import BlurImage from "../blur-image";export default function Features() {const [activeFeature, setActiveFeature] = useState(0);-- const { setShowAddEditLinkModal, AddEditLinkModal } = useAddEditLinkModal({- props: DEFAULT_LINK_PROPS,- homepageDemo: true,- });- const { setShowLinkQRModal, LinkQRModal } = useLinkQRModal({- props: {- key: "github",- url: "https://github.com/steven-tey/dub",- },- });return (<div id="features">- <AddEditLinkModal />- <LinkQRModal />- {featureList.map(({ key, demo }) => (- // preload videos- <link key={key} rel="preload" as="video" href={demo} />- ))}<MaxWidthWrapper className="pb-10 pt-24"><div className="mx-auto max-w-md text-center sm:max-w-xl"><h2 className="font-display text-4xl font-extrabold leading-tight text-black sm:text-5xl sm:leading-tight">@@ -150,41 +41,32 @@ export default function Features() {type="single"defaultValue="analytics"onValueChange={(e) => {- setActiveFeature(featureList.findIndex(({ key }) => key === e));+ setActiveFeature(+ FEATURES_LIST.findIndex(({ slug }) => slug === e),+ );}}>- {featureList.map(({ key, title, icon, description, cta }) => (- <AccordionItem key={key} value={key}>+ {FEATURES_LIST.map((feature) => (+ <AccordionItem key={feature.slug} value={feature.slug}><AccordionTrigger><div className="flex items-center space-x-3 p-3">- {icon}+ <feature.icon className="h-5 w-5 text-gray-500" /><h3 className="text-base font-semibold text-gray-600">- {title}+ {feature.accordionTitle}</h3></div></AccordionTrigger><AccordionContent><div className="p-3"><p className="mb-4 text-sm text-gray-500">- {description}+ {feature.description}</p>- {key === "link" ? (- <button- onClick={() => setShowAddEditLinkModal(true)}- className="block max-w-fit rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"- >- View demo- </button>- ) : key === "qr" ? (- <button- onClick={() => setShowLinkQRModal(true)}- className="block max-w-fit rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"- >- View demo- </button>- ) : (- cta- )}+ <Link+ href={`/features/${feature.slug}`}+ className="block max-w-fit rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-all hover:bg-white hover:text-black"+ >+ Learn more+ </Link></div></AccordionContent></AccordionItem>@@ -192,11 +74,11 @@ export default function Features() {</Accordion><div className="lg:col-span-2"><AnimatePresence mode="wait">- {featureList.map((feature, index) => {+ {FEATURES_LIST.map((feature, index) => {if (index === activeFeature) {return (<motion.div- key={feature.title}+ key={feature.slug}initial={{y: 10,opacity: 0,@@ -213,17 +95,13 @@ export default function Features() {}}className="relative min-h-[600px] w-full overflow-hidden whitespace-nowrap rounded-2xl bg-white shadow-2xl lg:mt-10 lg:w-[800px]">- <video- autoPlay- muted- loop+ <BlurImage+ src={feature.thumbnail}+ alt={feature.title}+ className="absolute inset-0 h-full w-full object-cover"width={800}height={600}- poster={feature.thumbnail}- >- <source src={feature.demo} type="video/mp4" />- Your browser does not support the video tag.- </video>+ /></motion.div>);}diff --git a/app/ui/home/footer.tsx b/app/ui/home/footer.tsxindex 9e6ce1865b..c30cb83608 100644--- a/app/ui/home/footer.tsx+++ b/app/ui/home/footer.tsx@@ -6,10 +6,10 @@ import { Github, LinkedIn, Twitter } from "@/components/shared/icons";import { useParams } from "next/navigation";import MaxWidthWrapper from "@/components/shared/max-width-wrapper";import va from "@vercel/analytics";-import { features } from "#/lib/constants/content";+import { FEATURES_LIST } from "#/lib/constants/content";const navigation = {- features: features.map(({ shortTitle, slug }) => ({+ features: FEATURES_LIST.map(({ shortTitle, slug }) => ({name: shortTitle,href: `/features/${slug}`,})),diff --git a/app/ui/home/logos.tsx b/app/ui/home/logos.tsxindex a888082d98..d5933abc8e 100644--- a/app/ui/home/logos.tsx+++ b/app/ui/home/logos.tsx@@ -58,7 +58,7 @@ export default function Logos({copy?: string;}) {return (- <div className="mt-20">+ <div className="my-10"><p className="mx-auto max-w-sm text-center text-gray-600 sm:max-w-xl sm:text-lg">{copy}</p>diff --git a/app/ui/home/stats.tsx b/app/ui/home/stats.tsxindex f991c779d2..b8904f6811 100644--- a/app/ui/home/stats.tsx+++ b/app/ui/home/stats.tsx@@ -43,16 +43,16 @@ export function StatsSection({<div className="border-y border-gray-200 bg-white/10 py-8 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] backdrop-blur"><MaxWidthWrapper className="grid gap-y-4 divide-x divide-gray-200 md:grid-cols-3 md:gap-y-0">{[- { name: "Custom Domains", value: domains },- { name: "Short Links", value: shortlinks },- { name: "Link Redirects", value: clicks },+ { name: "Active Companies", value: domains },+ { name: "Short Links Created", value: shortlinks },+ { name: "Link Redirects Tracked", value: clicks },].map(({ name, value }) => (<divkey={name}className="flex flex-col items-center justify-center space-y-2"><p className="text-4xl font-bold md:text-6xl">- {name === "Custom Domains"+ {name === "Active Companies"? Intl.NumberFormat().format(value): nFormatter(value)}</p>diff --git a/lib/constants/content.tsx b/lib/constants/content.tsxindex f471272573..4ea255de61 100644--- a/lib/constants/content.tsx+++ b/lib/constants/content.tsx@@ -1,6 +1,17 @@import { Logo } from "#/ui/icons";import { allHelpPosts } from "contentlayer/generated";-import { Globe, Import, Link2, Lock, Settings, Webhook } from "lucide-react";+import {+ Airplay,+ BarChart,+ Globe,+ Import,+ Link2,+ Lock,+ QrCode,+ Settings,+ Users,+ Webhook,+} from "lucide-react";export const BLOG_CATEGORIES: {title: string;@@ -96,28 +107,61 @@ export const getPopularArticles = () => {);};-export const features = [+export const FEATURES_LIST = [{- title: "Powerful Analytics for the Modern Marketer",+ title: "Powerful analytics for the modern marketer",shortTitle: "Advanced Analytics",+ accordionTitle: "Analytics that matter",+ description:+ "Dub provides powerful analytics for your links, including geolocation, device, browser, and referrer information.",+ icon: BarChart,slug: "analytics",+ thumbnail:+ "https://media.cleanshot.cloud/media/42580/FUSjMlxa2Xqne98F9KO5i960094hS5XinPIfgC9r.jpeg?Expires=1693806001&Signature=H5-txoTKREO1I7R-X05XDKQK2lS6EdMjnmb5MSTgfAsx-cJ4gXipCu99TZxJovoFGyBy2yLnVn3WrBhRtr~XkAhk0REtXrtLCpRe~dy0WJymLacZ-joGNIT203o5TptMueNAhWJIzdURsVJTl7VkU94BFHKCt31am8UuAIm8hh-ZI3YnjIteS9lNe4c2AJ2c6pDecNLjdG8OG6VeddSW29Lgehqdx4c3qKSTSbaL8fH0Hn-ez4spG4iHBgOXerY1R2kvaVaxjY6qN1OFZ9dWjiDIFAGo~MggxxNn8zSKwJHTtCqzKG9EYP-dozIjb-kmmlao0eolGHi1bh9tVUofuA__&Key-Pair-Id=K269JMAT9ZF4GZ",},{title: "Branded Links that Stand Out",shortTitle: "Branded Links",+ accordionTitle: "Use your own domain",+ description:+ "Dub offers free and unlimited custom domains on all plans for you to create branded links that stand out.",+ icon: Airplay,slug: "branded-links",+ thumbnail:+ "https://media.cleanshot.cloud/media/42580/FUSjMlxa2Xqne98F9KO5i960094hS5XinPIfgC9r.jpeg?Expires=1693806001&Signature=H5-txoTKREO1I7R-X05XDKQK2lS6EdMjnmb5MSTgfAsx-cJ4gXipCu99TZxJovoFGyBy2yLnVn3WrBhRtr~XkAhk0REtXrtLCpRe~dy0WJymLacZ-joGNIT203o5TptMueNAhWJIzdURsVJTl7VkU94BFHKCt31am8UuAIm8hh-ZI3YnjIteS9lNe4c2AJ2c6pDecNLjdG8OG6VeddSW29Lgehqdx4c3qKSTSbaL8fH0Hn-ez4spG4iHBgOXerY1R2kvaVaxjY6qN1OFZ9dWjiDIFAGo~MggxxNn8zSKwJHTtCqzKG9EYP-dozIjb-kmmlao0eolGHi1bh9tVUofuA__&Key-Pair-Id=K269JMAT9ZF4GZ",},- { title: "Custom QR Codes", shortTitle: "QR Codes", slug: "qr-codes" },{- title: "Personalize Your Link's Behavior",- seoTitle: "Personalize Your Link's Behavior with Device and Geo Targeting",+ title: "Free QR Code Generator",+ shortTitle: "QR Codes",+ accordionTitle: "Free QR Code Generator",+ description:+ "QR codes and short links are like peas in a pod. Dub offers free QR codes for every short link you create.",+ icon: QrCode,+ slug: "qr-codes",+ thumbnail:+ "https://media.cleanshot.cloud/media/42580/FUSjMlxa2Xqne98F9KO5i960094hS5XinPIfgC9r.jpeg?Expires=1693806001&Signature=H5-txoTKREO1I7R-X05XDKQK2lS6EdMjnmb5MSTgfAsx-cJ4gXipCu99TZxJovoFGyBy2yLnVn3WrBhRtr~XkAhk0REtXrtLCpRe~dy0WJymLacZ-joGNIT203o5TptMueNAhWJIzdURsVJTl7VkU94BFHKCt31am8UuAIm8hh-ZI3YnjIteS9lNe4c2AJ2c6pDecNLjdG8OG6VeddSW29Lgehqdx4c3qKSTSbaL8fH0Hn-ez4spG4iHBgOXerY1R2kvaVaxjY6qN1OFZ9dWjiDIFAGo~MggxxNn8zSKwJHTtCqzKG9EYP-dozIjb-kmmlao0eolGHi1bh9tVUofuA__&Key-Pair-Id=K269JMAT9ZF4GZ",+ },+ {+ title: "Personalize Your Short links",shortTitle: "Personalization",+ accordionTitle: "Personalize Your Short links",+ description:+ "Customize your link's behavior with device targeting, geo targeting, link cloaking, and more.",+ icon: Link2,slug: "personalization",+ thumbnail:+ "https://media.cleanshot.cloud/media/42580/FUSjMlxa2Xqne98F9KO5i960094hS5XinPIfgC9r.jpeg?Expires=1693806001&Signature=H5-txoTKREO1I7R-X05XDKQK2lS6EdMjnmb5MSTgfAsx-cJ4gXipCu99TZxJovoFGyBy2yLnVn3WrBhRtr~XkAhk0REtXrtLCpRe~dy0WJymLacZ-joGNIT203o5TptMueNAhWJIzdURsVJTl7VkU94BFHKCt31am8UuAIm8hh-ZI3YnjIteS9lNe4c2AJ2c6pDecNLjdG8OG6VeddSW29Lgehqdx4c3qKSTSbaL8fH0Hn-ez4spG4iHBgOXerY1R2kvaVaxjY6qN1OFZ9dWjiDIFAGo~MggxxNn8zSKwJHTtCqzKG9EYP-dozIjb-kmmlao0eolGHi1bh9tVUofuA__&Key-Pair-Id=K269JMAT9ZF4GZ",},- { title: "Programmatic Link Creation", shortTitle: "API", slug: "api" },+ // { title: "Programmatic Link Creation", shortTitle: "API", slug: "api" },{title: "Collaborate With Your Team",shortTitle: "Team collaboration",+ accordionTitle: "Collaborate With Your Team",+ description:+ "Invite your teammates to collaborate on your links. For enterprises, Dub offers SAML SSO for better security.",+ icon: Users,slug: "collaboration",+ thumbnail:+ "https://media.cleanshot.cloud/media/42580/FUSjMlxa2Xqne98F9KO5i960094hS5XinPIfgC9r.jpeg?Expires=1693806001&Signature=H5-txoTKREO1I7R-X05XDKQK2lS6EdMjnmb5MSTgfAsx-cJ4gXipCu99TZxJovoFGyBy2yLnVn3WrBhRtr~XkAhk0REtXrtLCpRe~dy0WJymLacZ-joGNIT203o5TptMueNAhWJIzdURsVJTl7VkU94BFHKCt31am8UuAIm8hh-ZI3YnjIteS9lNe4c2AJ2c6pDecNLjdG8OG6VeddSW29Lgehqdx4c3qKSTSbaL8fH0Hn-ez4spG4iHBgOXerY1R2kvaVaxjY6qN1OFZ9dWjiDIFAGo~MggxxNn8zSKwJHTtCqzKG9EYP-dozIjb-kmmlao0eolGHi1bh9tVUofuA__&Key-Pair-Id=K269JMAT9ZF4GZ",},];diff --git a/public/_static/features/analytics.png b/public/_static/features/analytics.pngdeleted file mode 100644index 3eabfb5397..0000000000Binary files a/public/_static/features/analytics.png and /dev/null differ