Skip to content

feat: use fumadocs for website #1654

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

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
86675ec
refactor: move examples into an src directory
nperez0111 Apr 30, 2025
b909c73
feat: fumadocs
nperez0111 May 7, 2025
20f553c
Merge branch 'main' into fumadocs
nperez0111 Jun 10, 2025
2c2e840
fix: ai examples working again
nperez0111 Jun 10, 2025
c43cc09
chore: update deps
nperez0111 Jun 10, 2025
f8fdc6f
feat: ton more for fumadocs
nperez0111 Jun 11, 2025
2714655
chore: rm .source
nperez0111 Jun 11, 2025
4afa6bb
chore: add react compiler
nperez0111 Jun 12, 2025
18d0d1f
docs: Fumadocs migration (#1769)
matthewlipski Jun 27, 2025
9e729d6
Implemented PR feedback
matthewlipski Jul 2, 2025
614d477
Small fix
matthewlipski Jul 2, 2025
b92b54d
Moved example data from collection to generated file
matthewlipski Jul 2, 2025
ee31027
- Made footer always full width
matthewlipski Jul 2, 2025
c065253
Revert next config
matthewlipski Jul 3, 2025
023a508
Finished cleaning example data for components
matthewlipski Jul 3, 2025
bbf1539
NextJS-esque layout PoC
matthewlipski Jul 4, 2025
1695548
- Removed ToC dropdown from mobile view
matthewlipski Jul 7, 2025
df74163
Merge branch 'main' into fumadocs
matthewlipski Jul 8, 2025
154768d
Additional merge fixes
matthewlipski Jul 8, 2025
64652da
Merge branch 'main' into fumadocs
matthewlipski Jul 8, 2025
152b67a
chore: regenerate pnpm lock
nperez0111 Jul 8, 2025
90a9435
feat: content re-organization (#1772)
nperez0111 Jul 8, 2025
13292fe
chore: pnpm-lock
nperez0111 Jul 8, 2025
27ac625
chore:
nperez0111 Jul 8, 2025
d9995a3
chore: bump packages
nperez0111 Jul 8, 2025
2380f9c
chore: forget ending tag
nperez0111 Jul 8, 2025
b7cdacf
docs: minor cleanup
nperez0111 Jul 9, 2025
9b1accb
build: get project to build again
nperez0111 Jul 9, 2025
72a0240
Fixed styles
matthewlipski Jul 9, 2025
dc5c350
Streamlined README
matthewlipski Jul 9, 2025
06bdaa5
Merge branch 'main' into fumadocs
matthewlipski Jul 10, 2025
e750e81
Fixed some themed images in docs
matthewlipski Jul 10, 2025
c8e6513
Fixed fumadocs build
matthewlipski Jul 10, 2025
1fef181
Updated pnpm lock
matthewlipski Jul 10, 2025
ff2be4f
chore: approve-build
nperez0111 Jul 10, 2025
16f654c
docs: add email docs
nperez0111 Jul 10, 2025
9ed7a3f
feat: move fumadocs over the docs
nperez0111 Jul 10, 2025
7cd60c3
chore: approve build
nperez0111 Jul 10, 2025
05f9534
chore: lockfile
nperez0111 Jul 10, 2025
ce18d23
chore: force pnpm store to be set
nperez0111 Jul 10, 2025
0be1e22
build: fix dev script
nperez0111 Jul 10, 2025
f952830
chore: recreate dir
nperez0111 Jul 10, 2025
d5dd507
build: use turbopack
nperez0111 Jul 10, 2025
03b0f11
chore: update link
nperez0111 Jul 10, 2025
6b672a8
Fixed build & examples root
matthewlipski Jul 10, 2025
60066f2
fix: do not delete examples files, show react email
nperez0111 Jul 11, 2025
28b5cd1
fix: include tailwind base
nperez0111 Jul 11, 2025
a302644
docs: update all links to point to the right spots
nperez0111 Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
"search.defaultViewMode": "tree",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[mdx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
9 changes: 2 additions & 7 deletions docs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "next/core-web-vitals",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"import/extensions": 0,
"@next/next/no-img-element": "off"
},
"root": true
"import/extensions": 0
}
}
7 changes: 6 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

# database
*.db

# Sentry Config File
.env.sentry-build-plugin
*.db
/content/examples/*/*
/components/example/generated/
/.source/
99 changes: 0 additions & 99 deletions docs/DEVELOPMENT.md

This file was deleted.

104 changes: 94 additions & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,105 @@
# BlockNote Docs
# Website Development

This is the code for the [BlockNote documentation website](https://www.blocknotejs.org).
This is the code for the [BlockNote documentation website](https://www.blocknotejs.org). If you're looking to work on BlockNote itself, check the [`packages`](/packages/) folder.

If you're looking to work on BlockNote itself, check the [`packages`](/packages/) folder.
To get started with development of the website, you can follow these steps:

## Getting Started
1. Initialize the DB

First, run `npm run build` in the repository root.
If you haven't already, you can initialize the database with the following command:

Next, run the development server:
```bash
cd docs && pnpm run init-db
```

This will initialize an SQLite database at `./docs/sqlite.db`.

2. Setup environment variables

Copy the `.env.example` file to `.env.local` and set the environment variables.

```bash
cp .env.example .env.local
```

If you want to test logging in, or payments see more information below [in the environment variables section](#environment-variables).

3. Start the development server from within the `./docs` directory.

```bash
pnpm run dev
```

This will start the development server on port 3000.

## Environment Variables

### Logging in

To test logging in, you can set the following environment variables:

```bash
AUTH_SECRET=test
# Github OAuth optionally
AUTH_GITHUB_ID=test
AUTH_GITHUB_SECRET=test
```

Note: the GITHUB_ID and GITHUB_SECRET are optional, but if you want to test logging in with Github you'll need to set them. For local development, you'll need to set the callback URL to `http://localhost:3000/api/auth/callback/github`

### Payments

To test payments, you can set the following environment variables:

```bash
POLAR_ACCESS_TOKEN=test
POLAR_WEBHOOK_SECRET=test
```

For testing payments, you'll need access to the polar sandbox which needs to be configured to point a webhook to your local server. This can be configured at: <https://sandbox.polar.sh/dashboard/blocknote/settings/webhooks>

You'll need something like [ngrok](https://ngrok.com/) to expose your local server to the internet.

```bash
ngrok http http://localhost:3000
```

You'll need the webhook to point to ngrok like so:

```
https://0000-00-00-000-00.ngrok-free.app/api/auth/polar/webhooks
```

With this webhook pointing to your local server, you should be able to test payments.

### Email sending

Note, this is not required, if email sending is not configured, the app will log the email it would send to the console. Often this is more convenient for development.

To test email sending, you can set the following environment variables:

```bash
npm run dev
SMTP_HOST=
SMTP_USER=
SMTP_PASS=
SMTP_PORT=
SMTP_SECURE=false
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
When configured, you'll be able to send emails to the email address you've configured.

To setup with protonmail, you'll need to go to <https://account.proton.me/u/0/mail/imap-smtp> and create a new SMTP submission token.

You'll need to set the following environment variables:

```bash
SMTP_HOST=smtp.protonmail.com
[email protected]
SMTP_PASS=my-smtp-token
SMTP_PORT=587
SMTP_SECURE=false
```

## Merging
# Contributing

Open a pull request to the [BlockNote GitHub repo](https://github.com/TypeCellOS/BlockNote). Pull requests will automatically be deployed to a preview environment.
To submit your changes, open a pull request to the [BlockNote GitHub repo](https://github.com/TypeCellOS/BlockNote). Pull requests will automatically be deployed to a preview environment.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FC } from "react";
import { Contributors } from "@/components/pages/landing/community/Contributors";
import { Section } from "@/components/pages/landing/shared/Section";
import { Sponsors } from "@/components/pages/landing/community/Sponsors";
import { SectionIntro } from "@/components/pages/landing/shared/Headings";
import { Contributors } from "@/app/(home)/community/Contributors";
import { Section } from "@/components/Section";
import { Sponsors } from "@/app/(home)/community/Sponsors";
import { SectionIntro } from "@/components/Headings";

export const Community: FC = () => (
<Section gradientBackground className="pb-24 pt-12 xl:pb-32 xl:pt-16">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Link } from "nextra-theme-docs";
import Image from "next/image";
import { DiscordIcon, GitHubIcon } from "nextra/icons";
import { SectionSubHeader } from "@/components/pages/landing/shared/Headings";
import { JoinButton } from "@/components/pages/landing/community/JoinButton";
import { FadeIn } from "@/components/pages/landing/shared/FadeIn";
import Link from "next/link";
import { RiDiscordFill, RiGithubFill } from "react-icons/ri";
import { SectionSubHeader } from "@/components/Headings";
import { JoinButton } from "@/app/(home)/community/JoinButton";
import { FadeIn } from "@/components/FadeIn";

// TODO: Use GitHub API
function fetchContributors(): { username: string; avatarUrl: string }[] {
Expand Down Expand Up @@ -114,7 +114,7 @@ export const Contributors = () => (
subtext={
"Join the community of BlockNote developers by contributing code and supporting the project."
}
icon={GitHubIcon}
icon={<RiGithubFill size={32} />}
linkTitle={"See our repository"}
linkUrl={"https://github.com/TypeCellOS/BlockNote"}
/>
Expand All @@ -123,7 +123,7 @@ export const Contributors = () => (
subtext={
"Ask questions, discuss features, and share your work with other BlockNote users on Discord."
}
icon={DiscordIcon}
icon={<RiDiscordFill size={32} />}
linkTitle={"Join our Server"}
linkUrl={"https://discord.gg/Qc2QTTH5dF"}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import { Link } from "nextra-theme-docs";
import { ComponentProps, FC } from "react";
import Link from "next/link";
import { ReactNode } from "react";

export const JoinButton = (props: {
text: string;
subtext: string;
icon: FC<ComponentProps<"svg">>;
icon: ReactNode;
linkTitle: string;
linkUrl: string;
}) => {
const Icon = props.icon;

return (
<div
className={
"flex w-full flex-col items-start justify-between gap-4 rounded-lg bg-gray-50 p-4 sm:flex-row sm:items-center sm:gap-8 md:max-w-screen-md dark:bg-gray-800"
"border-fd-border flex w-full flex-col items-start justify-between gap-4 rounded-lg border p-4 sm:flex-row sm:items-center sm:gap-8 md:max-w-screen-md"
}
>
<div className={"hidden md:block md:w-fit"}>
<Icon width={30} />
</div>
<div className={"hidden md:block md:w-fit"}>{props.icon}</div>
<div className={"flex w-full flex-col items-start justify-start"}>
<h2
className={
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ThemedImage from "@/components/ThemedImage";
import Image from "next/image";

export type SponsorCardProps = {
Expand All @@ -14,19 +15,13 @@ export function SponsorCard(props: SponsorCardProps) {
return (
<a
href={props.link}
className="relative flex aspect-video max-w-[235px] items-center justify-center rounded-lg bg-gray-100 md:w-[235px] dark:bg-gray-900"
className="border-fd-border relative flex aspect-video max-w-[235px] items-center justify-center rounded-lg border"
>
<Image
className={"block h-1/3 w-3/5 object-contain dark:hidden"}
src={props.logo.light}
<ThemedImage
className={"h-1/3 w-3/5 object-contain"}
src={{ light: props.logo.light, dark: props.logo.dark }}
alt={props.name}
/>
<Image
className={"hidden h-1/3 w-3/5 object-contain dark:block"}
src={props.logo.dark}
alt={props.name}
/>

{props.tagline && (
<div className={"absolute bottom-[10%] text-xs italic md:text-sm"}>
{props.tagline}
Expand Down
Loading