Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update d.to/register → app.dub.co/register #2072

Merged
merged 4 commits into from
Feb 24, 2025
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: 1 addition & 1 deletion apps/web/app/[domain]/not-found/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function NotFoundLinkPage({
"animate-slide-up-fade motion-reduce:animate-fade-in [--offset:5px] [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]",
)}
>
<ButtonLink variant="primary" href="https://d.to/register">
<ButtonLink variant="primary" href="https://app.dub.co/register">
Try Dub today
</ButtonLink>
<ButtonLink
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/[domain]/placeholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function PlaceholderContent() {
"animate-slide-up-fade motion-reduce:animate-fade-in [--offset:5px] [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]",
)}
>
<ButtonLink variant="primary" href="https://d.to/register">
<ButtonLink variant="primary" href="https://app.dub.co/register">
Try Dub today
</ButtonLink>
<ButtonLink
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/banned/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default async function BannedPage({
"animate-slide-up-fade motion-reduce:animate-fade-in [--offset:5px] [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]",
)}
>
<ButtonLink variant="primary" href="https://d.to/register">
<ButtonLink variant="primary" href="https://app.dub.co/register">
Try Dub today
</ButtonLink>
<ButtonLink
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/expired/[domain]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default async function ExpiredLinkPage({
"animate-slide-up-fade motion-reduce:animate-fade-in [--offset:5px] [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]",
)}
>
<ButtonLink variant="primary" href="https://d.to/register">
<ButtonLink variant="primary" href="https://app.dub.co/register">
Try Dub today
</ButtonLink>
<ButtonLink
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"csv-parse": "^5.5.6",
"date-fns": "^3.6.0",
"dub": "^0.54.1",
"fast-xml-parser": "^5.0.6",
"framer-motion": "^10.16.16",
"fuse.js": "^6.6.2",
"geist": "^1.3.1",
Expand Down
38 changes: 38 additions & 0 deletions apps/web/scripts/sitemap-importer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import "dotenv-flow/config";
import { XMLParser } from "fast-xml-parser";
import { dub } from "../lib/dub";

async function fetchSitemap(url: string) {
const response = await fetch(url);
const xml = await response.text();
const parser = new XMLParser();
const result = parser.parse(xml);
return result.urlset.url.map((entry: { loc: string }) => entry.loc);
}

async function main() {
// Fetch and parse sitemap
const sitemapUrls = await fetchSitemap("https://dub.co/sitemap.xml");

// Filter out homepage and invalid URLs
const validUrls = sitemapUrls
.filter((url: string) => url !== "https://dub.co")
.map((url: string) => {
const urlObj = new URL(url);
return {
domain: "site.dub.co",
key: urlObj.pathname.slice(1),
url,
trackConversion: true,
folderId: "fold_fjA8lslBy2qFcosUrwWFxmfk",
};
})
.slice(200, 300);

console.log(`Found ${validUrls.length} valid URLs to process`);
// console.log(validUrls);

await dub.links.createMany(validUrls);
}

main().catch(console.error);
2 changes: 1 addition & 1 deletion apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export function AppSidebarNav({
slug: slug || "",
pathname,
queryString: getQueryString(undefined, {
include: ["folderId", "tagIds", "domain"],
include: ["folderId", "tagIds"],
}),
programs,
session: session || undefined,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/ui/placeholders/cta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function CTA({
</div>

<div className="relative mx-auto mt-10 flex max-w-fit space-x-4">
<ButtonLink variant="primary" href="https://d.to/register">
<ButtonLink variant="primary" href="https://app.dub.co/register">
Start for free
</ButtonLink>
<ButtonLink
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dub/ui",
"description": "UI components for Dub.co",
"version": "0.2.22",
"version": "0.2.23",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
19 changes: 2 additions & 17 deletions packages/ui/src/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APP_DOMAIN, cn, createHref, fetcher } from "@dub/utils";
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
import { LayoutGroup } from "framer-motion";
import Cookies from "js-cookie";
import Link from "next/link";
import { useParams, usePathname } from "next/navigation";
import { PropsWithChildren, SVGProps, createContext, useId } from "react";
Expand Down Expand Up @@ -90,12 +89,6 @@ export function Nav({
},
);

// here we need to check if the user has a dub_id cookie
// if they do, we should just use app.dub.co links
// if not, we can use conversion-enabled d.to links
const hasDubCookie =
domain === "dub.co" && Cookies.get("dub_id") ? true : false;

return (
<NavContext.Provider value={{ theme }}>
<LayoutGroup id={layoutGroupId}>
Expand Down Expand Up @@ -203,11 +196,7 @@ export function Nav({
) : !isLoading ? (
<>
<Link
href={
hasDubCookie
? "https://app.dub.co/login"
: "https://d.to/login"
}
href="https://app.dub.co/login"
className={cn(
buttonVariants({ variant: "secondary" }),
"flex h-8 items-center rounded-lg border px-4 text-sm",
Expand All @@ -217,11 +206,7 @@ export function Nav({
Log in
</Link>
<Link
href={
hasDubCookie
? "https://app.dub.co/register"
: "https://d.to/register"
}
href="https://app.dub.co/register"
className={cn(
buttonVariants({ variant: "primary" }),
"flex h-8 items-center rounded-lg border px-4 text-sm",
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

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

Loading