forked from dubinc/dub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
adc20a5
commit a51f85e
Showing
32 changed files
with
3,159 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,5 @@ next-env.d.ts | |
/pages/api/scripts* | ||
deleted-projects.json | ||
.mailing | ||
.contentlayer | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import type { Metadata } from "next"; | ||
import { notFound } from "next/navigation"; | ||
import { allPosts } from "contentlayer/generated"; | ||
import { MDX } from "@/components/shared/mdx"; | ||
import Link from "next/link"; | ||
import { ArrowLeft } from "lucide-react"; | ||
import { formatDate } from "@/lib/utils"; | ||
import { getBlurDataURL, getImages } from "@/lib/images"; | ||
import getTweets from "@/lib/twitter"; | ||
import BlurImage from "@/components/shared/blur-image"; | ||
import getRepos from "@/lib/github"; | ||
|
||
export async function generateStaticParams() { | ||
return allPosts.map((post) => ({ | ||
slug: post.slug, | ||
})); | ||
} | ||
|
||
export async function generateMetadata({ | ||
params, | ||
}: { | ||
params: { slug: string }; | ||
}): Promise<Metadata | undefined> { | ||
const post = allPosts.find((post) => post.slug === params.slug); | ||
if (!post) { | ||
return; | ||
} | ||
|
||
const { | ||
title, | ||
publishedAt: publishedTime, | ||
summary: description, | ||
image, | ||
slug, | ||
} = post; | ||
|
||
return { | ||
title, | ||
description, | ||
openGraph: { | ||
title, | ||
description, | ||
type: "article", | ||
publishedTime, | ||
url: `https://dub.sh/changelog/${slug}`, | ||
images: [ | ||
{ | ||
url: image, | ||
}, | ||
], | ||
}, | ||
twitter: { | ||
card: "summary_large_image", | ||
title, | ||
description, | ||
images: [image], | ||
}, | ||
}; | ||
} | ||
|
||
export default async function ChangelogPost({ | ||
params, | ||
}: { | ||
params: { slug: string }; | ||
}) { | ||
const post = allPosts.find((post) => post.slug === params.slug); | ||
if (!post) { | ||
notFound(); | ||
} | ||
|
||
const [images, tweets, repos] = await Promise.all([ | ||
getImages(post.images), | ||
getTweets(post.tweetIds), | ||
getRepos(post.githubRepos), | ||
]); | ||
|
||
return ( | ||
<div className="lg:relative"> | ||
<div className="mx-auto mb-20 max-w-2xl"> | ||
<Link | ||
href="/blog" | ||
className="group ml-5 mb-8 flex h-10 w-10 items-center justify-center rounded-full bg-white shadow-md shadow-zinc-800/5 ring-1 ring-zinc-900/5 transition sm:ml-0 lg:absolute lg:-left-5 lg:mb-0 lg:-mt-2 xl:-top-1.5 xl:left-0 xl:mt-0" | ||
> | ||
<span className="sr-only">Back to blog</span> | ||
<ArrowLeft className="h-4 w-4 stroke-zinc-500 transition group-hover:stroke-zinc-700" /> | ||
</Link> | ||
<div> | ||
<div className="mx-5 flex flex-col sm:mx-auto"> | ||
<h1 className="mt-6 font-display text-4xl font-bold tracking-tight text-zinc-800 sm:text-5xl"> | ||
{post.title} | ||
</h1> | ||
<time | ||
dateTime={post.publishedAt} | ||
className="order-first flex items-center text-base text-zinc-500" | ||
> | ||
<span className="h-4 w-0.5 rounded-full bg-zinc-200" /> | ||
<span className="ml-3">{formatDate(post.publishedAt)}</span> | ||
</time> | ||
</div> | ||
<BlurImage | ||
src={post.image} | ||
alt={post.title} | ||
width={1200} | ||
height={900} | ||
priority // since it's above the fold | ||
placeholder="blur" | ||
blurDataURL={await getBlurDataURL(post.image!)} | ||
className="my-10 sm:rounded-3xl" | ||
/> | ||
|
||
<MDX | ||
code={post.body.code} | ||
images={images} | ||
tweets={tweets} | ||
repos={repos} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Changelog() { | ||
return <div></div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { Github, Logo, Twitter } from "@/components/shared/icons"; | ||
import NavigationMenu from "./navigation-menu"; | ||
|
||
const title = "Dub - Link Management for Modern Marketing Teams"; | ||
const description = | ||
"Dub is an open-source link management tool for modern marketing teams to create, share, and track short links."; | ||
|
||
export const metadata = { | ||
title, | ||
description, | ||
twitter: { | ||
card: "summary_large_image", | ||
title, | ||
description, | ||
creator: "@dubdotsh", | ||
}, | ||
metadataBase: new URL("https://dub.sh"), | ||
themeColor: "#FFF", | ||
}; | ||
|
||
export default function MarketingLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<div className="flex min-h-screen flex-col justify-between"> | ||
<div className="z-20"> | ||
<div className="mx-auto max-w-screen-xl px-5 md:px-20"> | ||
<div className="flex h-16 items-center justify-between"> | ||
<div className="flex items-center"> | ||
<Link href="/"> | ||
<Image | ||
src="/_static/logotype.svg" | ||
alt="Dub.sh logo" | ||
width={834} | ||
height={236} | ||
className="w-24" | ||
/> | ||
</Link> | ||
</div> | ||
|
||
<NavigationMenu /> | ||
|
||
<div className="w-24"> | ||
<Link | ||
href={ | ||
process.env.NEXT_PUBLIC_VERCEL_ENV === "production" | ||
? "https://app.dub.sh/login" | ||
: "http://app.localhost:3000/login" | ||
} | ||
className="rounded-full border border-black bg-black py-1.5 px-5 text-sm text-white transition-all hover:bg-white hover:text-black" | ||
> | ||
Sign in | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{children} | ||
<div className="z-10 flex h-20 items-center justify-center space-x-12 border-t border-gray-200"> | ||
<a href="https://twitter.com/dubdotsh" target="_blank" rel="noreferrer"> | ||
<span className="sr-only">Twitter</span> | ||
<Twitter className="h-6 w-6 text-gray-600" /> | ||
</a> | ||
<Link href="/"> | ||
<span className="sr-only">Dub.sh Logo</span> | ||
<Logo className="h-7 w-7 text-gray-600" /> | ||
</Link> | ||
<a | ||
href="https://github.com/steven-tey/dub" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
<span className="sr-only">Github</span> | ||
<Github className="h-6 w-6 text-gray-600" /> | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import "@/styles/globals.css"; | ||
import { satoshi, inter } from "@/styles/fonts"; | ||
import { Analytics } from "@vercel/analytics/react"; | ||
import cx from "classnames"; | ||
|
||
export default async function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body className={cx(satoshi.variable, inter.variable)}> | ||
{children} | ||
<Analytics /> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"use client"; | ||
|
||
import Image, { ImageProps } from "next/image"; | ||
import { useEffect, useState } from "react"; | ||
|
||
|
Oops, something went wrong.