Skip to content

Commit 647e402

Browse files
Merge pull request #9 from OpenZeppelin/feat/add-netlify-config
feat: added netlify config
2 parents be4c9cd + a9b2175 commit 647e402

File tree

9 files changed

+81
-47
lines changed

9 files changed

+81
-47
lines changed

content/contracts/index.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Contracts
3+
description: OpenZeppelin Contracts documentation
4+
---
5+
6+
# OpenZeppelin Contracts
7+
8+
Welcome to the OpenZeppelin Contracts documentation. Choose your version:
9+
10+
- [v5.x (Latest)](/contracts/v5.x/) - Latest stable version with new features
11+
- [v4.x](/contracts/v4.x/) - Previous major version
12+
- [v3.x](/contracts/v3.x/) - Legacy version
13+
- [v2.x](/contracts/v2.x/) - Legacy version

next.config.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { createMDX } from 'fumadocs-mdx/next';
1+
import { createMDX } from "fumadocs-mdx/next";
22

33
const withMDX = createMDX();
44

55
/** @type {import('next').NextConfig} */
66
const config = {
7-
reactStrictMode: true,
7+
reactStrictMode: true,
8+
output: "export",
89
};
910

1011
export default withMDX(config);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"dependencies": {
1818
"@netlify/plugin-nextjs": "^5.13.0",
19+
"@orama/orama": "^3.1.12",
1920
"@radix-ui/react-separator": "^1.1.7",
2021
"class-variance-authority": "^0.7.1",
2122
"clsx": "^2.1.1",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/api/search/route.ts

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

src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "@/app/global.css";
2-
import { RootProvider } from "fumadocs-ui/provider";
2+
import { Provider } from "./provider";
33
import { Inter } from "next/font/google";
44
import type { ReactNode } from "react";
55

@@ -11,7 +11,7 @@ export default function Layout({ children }: { children: ReactNode }) {
1111
return (
1212
<html lang="en" className={inter.className} suppressHydrationWarning>
1313
<body className="flex flex-col min-h-screen">
14-
<RootProvider>{children}</RootProvider>
14+
<Provider>{children}</Provider>
1515
</body>
1616
</html>
1717
);

src/app/provider.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"use client";
2+
3+
import { RootProvider } from "fumadocs-ui/provider";
4+
import type { ReactNode } from "react";
5+
6+
export function Provider({ children }: { children: ReactNode }) {
7+
return <RootProvider>{children}</RootProvider>;
8+
}

src/components/search.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"use client";
2+
import {
3+
SearchDialog,
4+
SearchDialogClose,
5+
SearchDialogContent,
6+
SearchDialogHeader,
7+
SearchDialogIcon,
8+
SearchDialogInput,
9+
SearchDialogList,
10+
SearchDialogOverlay,
11+
type SharedProps,
12+
} from "fumadocs-ui/components/dialog/search";
13+
import { useDocsSearch } from "fumadocs-core/search/client";
14+
import { create } from "@orama/orama";
15+
import { useI18n } from "fumadocs-ui/contexts/i18n";
16+
17+
function initOrama() {
18+
return create({
19+
schema: { _: "string" },
20+
// https://docs.orama.com/docs/orama-js/supported-languages
21+
language: "english",
22+
});
23+
}
24+
25+
export default function DefaultSearchDialog(props: SharedProps) {
26+
const { locale } = useI18n(); // (optional) for i18n
27+
const { search, setSearch, query } = useDocsSearch({
28+
type: "static",
29+
initOrama,
30+
locale,
31+
});
32+
33+
return (
34+
<SearchDialog
35+
search={search}
36+
onSearchChange={setSearch}
37+
isLoading={query.isLoading}
38+
{...props}
39+
>
40+
<SearchDialogOverlay />
41+
<SearchDialogContent>
42+
<SearchDialogHeader>
43+
<SearchDialogIcon />
44+
<SearchDialogInput />
45+
<SearchDialogClose />
46+
</SearchDialogHeader>
47+
<SearchDialogList items={query.data !== "empty" ? query.data : null} />
48+
</SearchDialogContent>
49+
</SearchDialog>
50+
);
51+
}

src/middleware.ts

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

0 commit comments

Comments
 (0)