Open source CapCut alternative.
TypeScript
feat(site): move the install page onto donkeycut.com
David Le2d5120687e78
diff --git a/site/src/app/_components/landing/data.ts b/site/src/app/_components/landing/data.tsindex 7a193f2b..d50ca2bf 100644--- a/site/src/app/_components/landing/data.ts+++ b/site/src/app/_components/landing/data.ts@@ -1,7 +1,10 @@import type { CardColor } from "@/app/_components/landing/theme";+import { DONKEYCUT_CANONICAL } from "@/cut/lib/hosts";+export const GITHUB_REPO_URL = "https://github.com/DonkeyUseCorp/Donkey";-export const DONKEY_INSTALL_URL = "/install";+// The install page lives on donkeycut.com only, so landing CTAs link absolute.+export const DONKEY_INSTALL_URL = `${DONKEYCUT_CANONICAL}/install`;export const DONKEY_LATEST_VERSION = "0.1.65";export const DONKEY_LATEST_RELEASE_TAG = `v${DONKEY_LATEST_VERSION}`;export const DONKEY_DOWNLOAD_URL = `${GITHUB_REPO_URL}/releases/download/${DONKEY_LATEST_RELEASE_TAG}/Donkey.dmg`;diff --git a/site/src/app/_components/landing/media-showcase/MediaDetailDialog.tsx b/site/src/app/_components/landing/media-showcase/MediaDetailDialog.tsxindex de1e2982..d204964c 100644--- a/site/src/app/_components/landing/media-showcase/MediaDetailDialog.tsx+++ b/site/src/app/_components/landing/media-showcase/MediaDetailDialog.tsx@@ -10,6 +10,7 @@ import {DialogTitle,} from "@/components/ui/dialog";import { PillButton } from "@/app/_components/landing/LandingPrimitives";+import { DONKEY_INSTALL_URL } from "@/app/_components/landing/data";import { CopyPromptButton } from "@/app/_components/landing/media-showcase/CopyPromptButton";import { type MediaShowcaseItem } from "@/app/_components/landing/media-showcase/data";@@ -116,7 +117,7 @@ export function MediaDetailDialog({ item, onClose }: Props) {Paste this prompt into Donkey to generate your own.</p><div className="mt-3">- <PillButton href="/install" variant="dark" size="sm">+ <PillButton href={DONKEY_INSTALL_URL} variant="dark" size="sm">Install Donkey<ArrowRight size={16} /></PillButton>diff --git a/site/src/app/cut/_components/landing/CutLanding.tsx b/site/src/app/cut/_components/landing/CutLanding.tsxindex c75b1031..dcfcb0a3 100644--- a/site/src/app/cut/_components/landing/CutLanding.tsx+++ b/site/src/app/cut/_components/landing/CutLanding.tsx@@ -1,16 +1,12 @@"use client";-import { TopNav } from "@/app/_components/landing/TopNav";-import {- signInHrefFor,- signUpHrefFor,-} from "@/app/_components/landing/useAppEntryHref";import { BG, BLACK } from "@/app/_components/landing/theme";import { CutFinalCTA } from "@/app/cut/_components/landing/CutFinalCTA";import { CutFooter } from "@/app/cut/_components/landing/CutFooter";import { CutHero } from "@/app/cut/_components/landing/CutHero";import { CutOpenSource } from "@/app/cut/_components/landing/CutOpenSource";import { CutPricing } from "@/app/cut/_components/landing/CutPricing";+import { CutTopNav } from "@/app/cut/_components/landing/CutTopNav";import { CutWorksWith } from "@/app/cut/_components/landing/CutWorksWith";// The donkeycut.com marketing page: the Donkey landing's cream visual system@@ -30,15 +26,7 @@ export function CutLanding({ root }: { root: string }) {WebkitFontSmoothing: "antialiased",}}>- <TopNav- homeHref={root || "/"}- wordmark="Donkey Cut"- signedInPill={{ href: `${root}/app`, label: "Go to App" }}- signedOutAuth={{- logInHref: signInHrefFor(`${root}/app`),- signUpHref: signUpHrefFor(`${root}/app`),- }}- />+ <CutTopNav root={root} /><CutHero root={root} /><CutWorksWith /><CutPricing root={root} />diff --git a/site/src/app/cut/_components/landing/CutTopNav.tsx b/site/src/app/cut/_components/landing/CutTopNav.tsxnew file mode 100644index 00000000..06e705a3--- /dev/null+++ b/site/src/app/cut/_components/landing/CutTopNav.tsx@@ -0,0 +1,25 @@+"use client";++import { TopNav } from "@/app/_components/landing/TopNav";+import {+ signInHrefFor,+ signUpHrefFor,+} from "@/app/_components/landing/useAppEntryHref";++// The donkeycut.com site nav: Donkey Cut wordmark with session-aware auth+// entries. Shared by the Cut landing and the pass-through pages (e.g.+// /install) served on that host. `root` is "" on donkeycut.com and local dev,+// "/cut" on the hosted apex.+export function CutTopNav({ root }: { root: string }) {+ return (+ <TopNav+ homeHref={root || "/"}+ wordmark="Donkey Cut"+ signedInPill={{ href: `${root}/app`, label: "Go to App" }}+ signedOutAuth={{+ logInHref: signInHrefFor(`${root}/app`),+ signUpHref: signUpHrefFor(`${root}/app`),+ }}+ />+ );+}diff --git a/site/src/app/cut/sitemap.ts b/site/src/app/cut/sitemap.tsindex 1a1b79d5..828c62af 100644--- a/site/src/app/cut/sitemap.ts+++ b/site/src/app/cut/sitemap.ts@@ -11,5 +11,10 @@ export default function sitemap(): MetadataRoute.Sitemap {changeFrequency: "weekly",priority: 1,},+ {+ url: `${DONKEYCUT_CANONICAL}/install`,+ changeFrequency: "monthly",+ priority: 0.8,+ },];}diff --git a/site/src/app/install/_components/InstallInstructions.tsx b/site/src/app/install/_components/InstallInstructions.tsxindex acd8361b..7b9cbf3f 100644--- a/site/src/app/install/_components/InstallInstructions.tsx+++ b/site/src/app/install/_components/InstallInstructions.tsx@@ -1,6 +1,5 @@import type { CSSProperties } from "react";import Image from "next/image";-import { ArrowRight } from "lucide-react";import {Headline,@@ -80,7 +79,7 @@ export function InstallInstructions() {like any other Mac app.</p><PillButton href={DONKEY_DOWNLOAD_URL} variant="primary" size="lg">- Download for Mac <ArrowRight size={18} />+ Download for Mac</PillButton></div></div>diff --git a/site/src/app/install/page.tsx b/site/src/app/install/page.tsxindex e4a6989d..967bfca4 100644--- a/site/src/app/install/page.tsx+++ b/site/src/app/install/page.tsx@@ -1,18 +1,29 @@import type { Metadata } from "next";+import { headers } from "next/headers";+import { notFound } from "next/navigation";-import { Footer } from "@/app/_components/landing/Footer";-import { TopNav } from "@/app/_components/landing/TopNav";import { BG, BLACK } from "@/app/_components/landing/theme";+import { CutFooter } from "@/app/cut/_components/landing/CutFooter";+import { CutTopNav } from "@/app/cut/_components/landing/CutTopNav";import { InstallInstructions } from "@/app/install/_components/InstallInstructions";--export const dynamic = "force-static";+import {+ DONKEYCUT_CANONICAL,+ isDonkeycutHost,+ isLocalHost,+} from "@/cut/lib/hosts";export const metadata: Metadata = {title: "Install Donkey",description: "Download Donkey for macOS and install it with the standard drag-to-Applications flow.",+ alternates: { canonical: `${DONKEYCUT_CANONICAL}/install` },};-export default function InstallPage() {+// The install page lives on donkeycut.com (passed through by src/proxy.ts) and+// wears the Cut site's header and footer; every other host 404s. Local dev+// mirrors donkeycut.com.+export default async function InstallPage() {+ const host = (await headers()).get("host");+ if (!isDonkeycutHost(host) && !isLocalHost(host)) notFound();return (<mainstyle={{@@ -23,9 +34,9 @@ export default function InstallPage() {WebkitFontSmoothing: "antialiased",}}>- <TopNav />+ <CutTopNav root="" /><InstallInstructions />- <Footer />+ <CutFooter /></main>);}diff --git a/site/src/app/sitemap.ts b/site/src/app/sitemap.tsindex 4cc9f941..45e47f96 100644--- a/site/src/app/sitemap.ts+++ b/site/src/app/sitemap.ts@@ -14,12 +14,6 @@ export default function sitemap(): MetadataRoute.Sitemap {priority: 1,url: `${SITE_URL}/`,},- {- changeFrequency: "monthly",- lastModified,- priority: 0.8,- url: `${SITE_URL}/install`,- },{changeFrequency: "monthly",lastModified,diff --git a/site/src/app/use-cases/[slug]/page.tsx b/site/src/app/use-cases/[slug]/page.tsxindex b16e492d..aa88d60c 100644--- a/site/src/app/use-cases/[slug]/page.tsx+++ b/site/src/app/use-cases/[slug]/page.tsx@@ -10,6 +10,7 @@ import {PillButton,TapedCard,} from "@/app/_components/landing/LandingPrimitives";+import { DONKEY_INSTALL_URL } from "@/app/_components/landing/data";import { CopyPromptButton } from "@/app/_components/landing/media-showcase/CopyPromptButton";import { TopNav } from "@/app/_components/landing/TopNav";import { getUseCase, useCases } from "@/app/use-cases/useCases";@@ -114,7 +115,7 @@ export default async function UseCasePage({ params }: PageProps) {{useCase.description}</p><div className="mt-8 flex flex-wrap gap-3">- <PillButton href="/install" variant="dark">+ <PillButton href={DONKEY_INSTALL_URL} variant="dark">Try this with Donkey<ArrowRight size={16} /></PillButton>diff --git a/site/src/app/use-cases/page.tsx b/site/src/app/use-cases/page.tsxindex 92e4d64e..edb97b4c 100644--- a/site/src/app/use-cases/page.tsx+++ b/site/src/app/use-cases/page.tsx@@ -8,6 +8,7 @@ import {PillButton,TapedCard,} from "@/app/_components/landing/LandingPrimitives";+import { DONKEY_INSTALL_URL } from "@/app/_components/landing/data";import { MediaShowcase } from "@/app/_components/landing/media-showcase/MediaShowcase";import { TopNav } from "@/app/_components/landing/TopNav";import {@@ -91,7 +92,7 @@ export default function UseCasesPage() {browser.</p><div className="mt-8 flex flex-wrap gap-3">- <PillButton href="/install" variant="dark">+ <PillButton href={DONKEY_INSTALL_URL} variant="dark">Try Donkey<ArrowRight size={16} /></PillButton>@@ -169,7 +170,7 @@ export default function UseCasesPage() {<Headline size="lg">Try Donkey today.</Headline></div><div className="flex flex-wrap items-center justify-center gap-3">- <PillButton href="/install" variant="primary">+ <PillButton href={DONKEY_INSTALL_URL} variant="primary">Install Donkey</PillButton></div>