Skip to content
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
13 changes: 13 additions & 0 deletions content/contracts/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Contracts
description: OpenZeppelin Contracts documentation
---

# OpenZeppelin Contracts

Welcome to the OpenZeppelin Contracts documentation. Choose your version:

- [v5.x (Latest)](/contracts/v5.x/) - Latest stable version with new features
- [v4.x](/contracts/v4.x/) - Previous major version
- [v3.x](/contracts/v3.x/) - Legacy version
- [v2.x](/contracts/v2.x/) - Legacy version
5 changes: 3 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createMDX } from 'fumadocs-mdx/next';
import { createMDX } from "fumadocs-mdx/next";

const withMDX = createMDX();

/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
reactStrictMode: true,
output: "export",
};

export default withMDX(config);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"dependencies": {
"@netlify/plugin-nextjs": "^5.13.0",
"@orama/orama": "^3.1.12",
"@radix-ui/react-separator": "^1.1.7",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

7 changes: 0 additions & 7 deletions src/app/api/search/route.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@/app/global.css";
import { RootProvider } from "fumadocs-ui/provider";
import { Provider } from "./provider";
import { Inter } from "next/font/google";
import type { ReactNode } from "react";

Expand All @@ -11,7 +11,7 @@ export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" className={inter.className} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
<Provider>{children}</Provider>
</body>
</html>
);
Expand Down
8 changes: 8 additions & 0 deletions src/app/provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use client";

import { RootProvider } from "fumadocs-ui/provider";
import type { ReactNode } from "react";

export function Provider({ children }: { children: ReactNode }) {
return <RootProvider>{children}</RootProvider>;
}
51 changes: 51 additions & 0 deletions src/components/search.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"use client";
import {
SearchDialog,
SearchDialogClose,
SearchDialogContent,
SearchDialogHeader,
SearchDialogIcon,
SearchDialogInput,
SearchDialogList,
SearchDialogOverlay,
type SharedProps,
} from "fumadocs-ui/components/dialog/search";
import { useDocsSearch } from "fumadocs-core/search/client";
import { create } from "@orama/orama";
import { useI18n } from "fumadocs-ui/contexts/i18n";

function initOrama() {
return create({
schema: { _: "string" },
// https://docs.orama.com/docs/orama-js/supported-languages
language: "english",
});
}

export default function DefaultSearchDialog(props: SharedProps) {
const { locale } = useI18n(); // (optional) for i18n
const { search, setSearch, query } = useDocsSearch({
type: "static",
initOrama,
locale,
});

return (
<SearchDialog
search={search}
onSearchChange={setSearch}
isLoading={query.isLoading}
{...props}
>
<SearchDialogOverlay />
<SearchDialogContent>
<SearchDialogHeader>
<SearchDialogIcon />
<SearchDialogInput />
<SearchDialogClose />
</SearchDialogHeader>
<SearchDialogList items={query.data !== "empty" ? query.data : null} />
</SearchDialogContent>
</SearchDialog>
);
}
36 changes: 0 additions & 36 deletions src/middleware.ts

This file was deleted.

Loading