Skip to content

docs: Examples, footer, and remaining pages #1784

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

Merged
merged 2 commits into from
Jun 23, 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 fumadocs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ next-env.d.ts

# Sentry Config File
.env.sentry-build-plugin
/content/examples/*/
/content/examples/**/*.mdx
/components/example/generated/
/.source/
14 changes: 10 additions & 4 deletions fumadocs/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import type { ReactNode } from 'react';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';
import type { ReactNode } from "react";
import { HomeLayout } from "fumadocs-ui/layouts/home";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";

export default function Layout({ children }: { children: ReactNode }) {
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
return (
<HomeLayout {...baseOptions}>
{children}
<Footer />
</HomeLayout>
);
}
2 changes: 2 additions & 0 deletions fumadocs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { DocsLayout } from "fumadocs-ui/layouts/notebook";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";
import { source } from "@/lib/source/docs";

export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout tree={source.pageTree} {...baseOptions}>
{children}
<Footer />
</DocsLayout>
);
}
2 changes: 2 additions & 0 deletions fumadocs/app/examples/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { DocsLayout } from "fumadocs-ui/layouts/notebook";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";
import { source } from "@/lib/source/examples";

export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout tree={source.pageTree} {...baseOptions}>
{children}
<Footer />
</DocsLayout>
);
}
19 changes: 12 additions & 7 deletions fumadocs/app/layout.config.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { AuthNavButton } from "@/components/AuthNavButton";
import { ThemedImage } from "@/components/ThemedImage";
import LogoLight from "@/public/img/logos/banner.svg";
import LogoDark from "@/public/img/logos/banner.dark.svg";
import type { DocsLayoutProps } from "fumadocs-ui/layouts/notebook";
import Image from "next/image";
import { FaBook, FaCode, FaDiscord, FaGithub, FaUser } from "react-icons/fa";

/**
Expand All @@ -14,12 +16,15 @@ export const baseOptions: Partial<DocsLayoutProps> = {
nav: {
title: (
<>
<ThemedImage
height={32}
width={170}
src="/img/logos/banner.svg"
darkImage={"/img/logos/banner.dark.svg"}
<Image
src={LogoLight}
alt="BlockNote"
className="block w-32 dark:hidden"
/>
<Image
src={LogoDark}
alt="BlockNote"
className="hidden w-32 dark:block"
/>
</>
),
Expand Down Expand Up @@ -54,7 +59,7 @@ export const baseOptions: Partial<DocsLayoutProps> = {
},
{
text: "About",
url: "/about",
url: "/pages/about",
active: "url",
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { getMDXComponents } from "@/util/mdx-components";
import { DocsBody, DocsDescription, DocsTitle } from "fumadocs-ui/page";
import { notFound } from "next/navigation";

export default async function Page() {
const page = source.getPage(["about"]);
console.log(source.getPageTree());
export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
}) {
const slug = (await props.params).slug || [];
const page = source.getPage(slug);
if (!page) {
notFound();
}
Expand All @@ -28,8 +30,11 @@ export async function generateStaticParams() {
return source.generateParams();
}

export async function generateMetadata() {
const page = source.getPage(["thanks"]);
export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
}) {
const slug = (await props.params).slug || [];
const page = source.getPage(slug);
if (!page) {
notFound();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";

export default function Layout({ children }: { children: ReactNode }) {
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
return (
<HomeLayout {...baseOptions}>
{children}
<Footer />
</HomeLayout>
);
}
8 changes: 7 additions & 1 deletion fumadocs/app/pricing/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { Footer } from "@/components/Footer";

export default function Layout({ children }: { children: ReactNode }) {
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
return (
<HomeLayout {...baseOptions}>
{children}
<Footer />
</HomeLayout>
);
}
7 changes: 0 additions & 7 deletions fumadocs/app/thanks/layout.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions fumadocs/app/thanks/page.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion fumadocs/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const auth = betterAuth({
// http://localhost:3000/api/auth/checkout/starter
},
],
successUrl: "/thanks",
successUrl: "/pages/thanks",
},
// Incoming Webhooks handler will be installed at /polar/webhooks
webhooks: {
Expand Down
2 changes: 1 addition & 1 deletion fumadocs/components/CTAButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function CTAButton(props: {
children: ReactNode;
}) {
return (
<div className="button-glow-parent relative flex h-fit w-fit flex-wrap">
<div className="not-prose button-glow-parent relative flex h-fit w-fit flex-wrap">
<Link
className={`bg-fd-accent border-fd-border text-fd-foreground z-20 m-0 rounded-full border font-medium ${props.size === "small" ? "px-3 py-1.5 text-xs md:text-sm" : "px-4 py-2 text-base md:text-lg"}`}
href={props.href}
Expand Down
30 changes: 21 additions & 9 deletions fumadocs/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import LogoLight from "@/public/img/logos/banner.svg";
import LogoDark from "@/public/img/logos/banner.dark.svg";
import cn from "classnames";
import Image from "next/image";
import Link from "next/link";
import type { ReactElement, ReactNode } from "react";
// import { Logo } from "./Logo";

function FooterLink({ href, children }: { href: string; children: ReactNode }) {
const classes =
"text-sm text-[#666666] dark:text-[#888888] no-underline betterhover:hover:text-gray-700 betterhover:hover:dark:text-white transition";
"text-sm text-[#666666] dark:text-[#888888] no-underline hover:text-gray-700 hover:dark:text-white transition";
if (href.startsWith("http")) {
return (
<a className={classes} href={href}>
Expand Down Expand Up @@ -44,14 +47,14 @@ const navigation = {
},
],
collaborate: () => [
{ name: "Partner with us", href: `/about#partner-with-us` },
{ name: "Partner with us", href: `/pages/about#partner-with-us` },
{
name: "Sponsorships",
href: `/about#sponsorships`,
href: `/pages/about#sponsorships`,
},
{
name: "Contribute",
href: `/about#contribute`,
href: `/pages/about#contribute`,
},
],
};
Expand All @@ -66,7 +69,16 @@ export function FooterContent() {
<div className="xl:grid xl:grid-cols-3 xl:gap-16">
<div className="">
{/* <FooterHeader>Subscribe to our newsletter</FooterHeader> */}
{/* <Logo /> */}
<Image
src={LogoLight}
alt="BlockNote"
className="block w-64 dark:hidden"
/>
<Image
src={LogoDark}
alt="BlockNote"
className="hidden w-64 dark:block"
/>
<p className="mt-4 text-sm text-gray-600 dark:text-[#888888]">
BlockNote is an extensible React rich text editor with support for
block-based editing, collaboration and comes with ready-to-use
Expand Down Expand Up @@ -110,12 +122,12 @@ export function FooterContent() {
<FooterHeader>Legal</FooterHeader>
<ul className="ml-0 mt-4 list-none space-y-1.5">
<li key={"terms-and-conditions"}>
<FooterLink href={"/legal/terms-and-conditions"}>
<FooterLink href={"/pages/terms-and-conditions"}>
Terms & Conditions
</FooterLink>
</li>
<li key={"privacy-policy"}>
<FooterLink href={"/legal/privacy-policy"}>
<FooterLink href={"/pages/privacy-policy"}>
Privacy Policy
</FooterLink>
</li>
Expand All @@ -140,7 +152,7 @@ export function FooterContent() {

export function Footer({ menu }: { menu?: boolean }): ReactElement {
return (
<footer className="relative bg-[#FAFAFA] pb-[env(safe-area-inset-bottom)] dark:bg-[#111111]">
<footer className="relative mt-10 bg-[#FAFAFA] pb-[env(safe-area-inset-bottom)] dark:bg-[#111111]">
{/* <div className="pointer-events-none absolute top-0 h-12 w-full -translate-y-full bg-gradient-to-t from-[#FAFAFA] to-transparent dark:from-black" /> */}
{/* <div
className={cn(
Expand Down
10 changes: 10 additions & 0 deletions fumadocs/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use client";

import LogoLight from "@/public/img/logos/banner.svg";
import LogoDark from "@/public/img/logos/banner.dark.svg";
import { useTheme } from "next-themes";

export default function Logo() {
const { resolvedTheme } = useTheme();
return resolvedTheme === "dark" ? LogoDark : LogoLight;
}
24 changes: 24 additions & 0 deletions fumadocs/components/ThemedExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";

import { BlockNoteContext } from "@blocknote/react";
import dynamic from "next/dynamic";
import { useTheme } from "next-themes";

export default function ThemedExample(props: { name: string }) {
const Component = dynamic(
() => import("./example/generated/components/" + props.name + "/index"),
{ ssr: false },
);

const { resolvedTheme } = useTheme();

return (
<BlockNoteContext.Provider
value={{
colorSchemePreference: resolvedTheme === "dark" ? "dark" : "light",
}}
>
<Component />
</BlockNoteContext.Provider>
);
}
19 changes: 0 additions & 19 deletions fumadocs/components/ThemedImage.tsx

This file was deleted.

Loading
Loading