Skip to content

Commit 38e5a5a

Browse files
authored
docs: Website upgrade and cleanup (#2371)
* npm create fumadocs * design * base ui untouched * revert, proper untouched * add menu groups * add content * added docs pages and examples * eject docs layout * fix docs configuration * add pages and error boundaries * move pages * setup sentry * next config to ts * basic header / footer * auth * add examples * llms + readmes * add homepage * wip: metadata * fix og images and metadata * fix build * fix lint * missing files * fix validate links * add email docs * migrate directory + fix cardtable * remove generated files from git * small cleanup * fix / upgrade deps * update lockfile * merge fix * try fix tests * fix * fix search z-index * nav fixes * fix nav button dark * not found * fix og * misc fixes * fix shadcn * remove comments * fix lint * remove fonts + add analytics * gitignore
1 parent 70e9080 commit 38e5a5a

299 files changed

Lines changed: 9655 additions & 6523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/.eslintrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/.gitignore

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,32 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
1+
# deps
42
/node_modules
5-
/.pnp
6-
.pnp.js
7-
.yarn/install-state.gz
83

9-
# testing
10-
/coverage
4+
# generated content
5+
.source
116

12-
# next.js
7+
# test & build
8+
/coverage
139
/.next/
1410
/out/
15-
16-
# production
1711
/build
12+
*.tsbuildinfo
1813

1914
# misc
2015
.DS_Store
2116
*.pem
22-
23-
# debug
17+
/.pnp
18+
.pnp.js
2419
npm-debug.log*
2520
yarn-debug.log*
2621
yarn-error.log*
2722

28-
# local env files
23+
# others
2924
.env*.local
30-
31-
# vercel
3225
.vercel
33-
34-
# typescript
35-
*.tsbuildinfo
3626
next-env.d.ts
37-
38-
# database
39-
*.db
40-
4127
# Sentry Config File
4228
.env.sentry-build-plugin
29+
4330
/content/examples/*/*
4431
/components/example/generated/
45-
/.source/
32+
sqlite.db

docs/app/(auth)/layout.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { HomeLayout } from "@/components/fumadocs/layout/home";
2+
import { baseOptions } from "@/lib/layout.shared";
3+
4+
export default function Layout({ children }: { children: React.ReactNode }) {
5+
return (
6+
<HomeLayout {...baseOptions()}>
7+
<div className="md:pt-8">{children}</div>
8+
</HomeLayout>
9+
);
10+
}

docs/app/(auth)/signin/page.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import AuthenticationPage from "@/components/AuthenticationPage";
2+
import { getFullMetadata } from "@/lib/getFullMetadata";
3+
import { Suspense } from "react";
4+
5+
export const metadata = getFullMetadata({
6+
title: "Sign In",
7+
path: "/signin",
8+
});
9+
10+
// Suspense + imported AuthenticationPage because AuthenticationPage is a client component
11+
// https://nextjs.org/docs/app/api-reference/functions/use-search-params#static-rendering
12+
export default function Page() {
13+
return (
14+
<Suspense>
15+
<AuthenticationPage variant="email" />
16+
</Suspense>
17+
);
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import AuthenticationPage from "@/components/AuthenticationPage";
2+
import { Metadata } from "next";
3+
import { Suspense } from "react";
4+
5+
export const metadata: Metadata = {
6+
title: "Password Login",
7+
};
8+
9+
// Suspense + imported AuthenticationPage because AuthenticationPage is a client component
10+
// https://nextjs.org/docs/app/api-reference/functions/use-search-params#static-rendering
11+
export default function Page() {
12+
return (
13+
<Suspense>
14+
<AuthenticationPage variant="password" />
15+
</Suspense>
16+
);
17+
}

docs/app/(auth)/signup/page.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import AuthenticationPage from "@/components/AuthenticationPage";
2+
import { getFullMetadata } from "@/lib/getFullMetadata";
3+
import { Suspense } from "react";
4+
5+
export const metadata = getFullMetadata({
6+
title: "Sign Up",
7+
path: "/signup",
8+
});
9+
10+
// Suspense + imported AuthenticationPage because AuthenticationPage is a client component
11+
// https://nextjs.org/docs/app/api-reference/functions/use-search-params#static-rendering
12+
export default function Page() {
13+
return (
14+
<Suspense>
15+
<AuthenticationPage variant="register" />
16+
</Suspense>
17+
);
18+
}

docs/app/(home)/community/Community.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { FC } from "react";
2-
import { Contributors } from "@/app/(home)/community/Contributors";
3-
import { Section } from "@/components/Section";
4-
import { Sponsors } from "@/app/(home)/community/Sponsors";
51
import { SectionIntro } from "@/components/Headings";
2+
import { Section } from "@/components/Section";
3+
import { FC } from "react";
4+
import { Contributors } from "./Contributors";
5+
import { Sponsors } from "./Sponsors";
66

77
export const Community: FC = () => (
88
<Section gradientBackground className="pb-24 pt-12 xl:pb-32 xl:pt-16">

docs/app/(home)/community/Contributors.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { FadeIn } from "@/components/FadeIn";
2+
import { SectionSubHeader } from "@/components/Headings";
13
import Image from "next/image";
24
import Link from "next/link";
35
import { RiDiscordFill, RiGithubFill } from "react-icons/ri";
4-
import { SectionSubHeader } from "@/components/Headings";
5-
import { JoinButton } from "@/app/(home)/community/JoinButton";
6-
import { FadeIn } from "@/components/FadeIn";
6+
import { JoinButton } from "./JoinButton";
77

88
// TODO: Use GitHub API
99
function fetchContributors(): { username: string; avatarUrl: string }[] {

docs/app/(home)/community/Sponsors.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import {
2-
SponsorCard,
3-
SponsorCardProps,
4-
} from "@/app/(home)/community/SponsorCard";
51
import { FadeIn } from "@/components/FadeIn";
62
import { SectionSubHeader } from "@/components/Headings";
3+
import { SponsorCard, SponsorCardProps } from "./SponsorCard";
74

85
import agree from "@/public/img/sponsors/agree.png";
96
import atuin from "@/public/img/sponsors/atuin.png";

docs/app/(home)/error.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"use client"; // Error boundaries must be Client Components
2+
3+
import * as Sentry from "@sentry/nextjs";
4+
import { DocsBody } from "fumadocs-ui/layouts/docs/page";
5+
import { useEffect } from "react";
6+
7+
export default function Error({
8+
error,
9+
reset,
10+
}: {
11+
error: Error & { digest?: string };
12+
reset: () => void;
13+
}) {
14+
useEffect(() => {
15+
Sentry.captureException(error, {
16+
tags: { type: "react-render", source: "home" },
17+
});
18+
}, [error]);
19+
20+
return (
21+
<div className="mx-auto max-w-3xl pt-8">
22+
<DocsBody>
23+
<h1>Whoops. What the blocks!?</h1>
24+
<div>
25+
We encountered an error trying to show this page. If this keeps
26+
occuring, an issue can be filed on GitHub at{" "}
27+
<a href="https://github.com/TypeCellOS/BlockNote/issues">
28+
https://github.com/TypeCellOS/BlockNote/issues
29+
</a>
30+
</div>
31+
</DocsBody>
32+
</div>
33+
);
34+
}

0 commit comments

Comments
 (0)