-
Notifications
You must be signed in to change notification settings - Fork 2
Migrate documentation from VitePress to Fumadocs #138
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2481bfe
Initial plan
Copilot 8c22259
feat: initialize fumadocs site structure in apps/site
Copilot 458d041
feat: add frontmatter to all MDX files and fix YAML issues
Copilot d5b65dd
feat: complete fumadocs migration with working test page
Copilot 17686a3
chore: clean up empty code change sections in the changes log
hotlong 4a839ac
Implement feature X to enhance user experience and fix bug Y in module Z
hotlong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "extends": "next/core-web-vitals" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.js | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # next.js | ||
| /.next/ | ||
| /out/ | ||
|
|
||
| # production | ||
| /build | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # local env files | ||
| .env*.local | ||
|
|
||
| # vercel | ||
| .vercel | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
|
|
||
| # fumadocs | ||
| .source |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { source } from '@/lib/source'; | ||
| import type { Metadata } from 'next'; | ||
| import { DocsPage, DocsBody, DocsDescription, DocsTitle } from 'fumadocs-ui/page'; | ||
| import { notFound } from 'next/navigation'; | ||
| import defaultMdxComponents from 'fumadocs-ui/mdx'; | ||
|
|
||
| export default async function Page({ | ||
| params, | ||
| }: { | ||
| params: { slug?: string[] }; | ||
| }) { | ||
| const page = source.getPage(params.slug); | ||
| if (!page) notFound(); | ||
|
|
||
| const MDX = page.data.body; | ||
|
|
||
| return ( | ||
| <DocsPage toc={page.data.toc} full={page.data.full}> | ||
| <DocsTitle>{page.data.title}</DocsTitle> | ||
| <DocsDescription>{page.data.description}</DocsDescription> | ||
| <DocsBody> | ||
| <MDX components={{ ...defaultMdxComponents }} /> | ||
| </DocsBody> | ||
| </DocsPage> | ||
| ); | ||
| } | ||
|
|
||
| export async function generateStaticParams() { | ||
| return source.generateParams(); | ||
| } | ||
|
|
||
| export function generateMetadata({ params }: { params: { slug?: string[] } }): Metadata { | ||
| const page = source.getPage(params.slug); | ||
| if (!page) notFound(); | ||
|
|
||
| return { | ||
| title: page.data.title, | ||
| description: page.data.description, | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { source } from '@/lib/source'; | ||
| import type { ReactNode } from 'react'; | ||
| import { DocsLayout } from 'fumadocs-ui/layout'; | ||
| import { baseOptions } from '@/app/layout.config'; | ||
|
|
||
| export default function Layout({ children }: { children: ReactNode }) { | ||
| return ( | ||
| <DocsLayout tree={source.pageTree} {...baseOptions}> | ||
| {children} | ||
| </DocsLayout> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| @tailwind base; | ||
| @tailwind components; | ||
| @tailwind utilities; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import type { DocsLayoutProps } from 'fumadocs-ui/layout'; | ||
| // @ts-ignore: optional dev dependency for icons (some environments may not have types) | ||
| import { Book, Code2, FileText, Sparkles } from 'lucide-react'; | ||
|
|
||
|
|
||
| export const baseOptions: Omit<DocsLayoutProps, 'tree'> = { | ||
| nav: { | ||
| title: 'ObjectQL', | ||
| }, | ||
| links: [ | ||
| { | ||
| text: 'Documentation', | ||
| url: '/docs', | ||
| active: 'nested-url', | ||
| }, | ||
| ], | ||
| githubUrl: 'https://github.com/objectstack-ai/objectql', | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import './globals.css'; | ||
| import type { ReactNode } from 'react'; | ||
| import { RootProvider } from 'fumadocs-ui/provider'; | ||
|
|
||
| export default function Layout({ children }: { children: ReactNode }) { | ||
| return ( | ||
| <html lang="en" suppressHydrationWarning> | ||
| <body> | ||
| <RootProvider>{children}</RootProvider> | ||
| </body> | ||
| </html> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export default function HomePage() { | ||
| return ( | ||
| <main className="flex h-screen flex-col items-center justify-center"> | ||
| <h1 className="mb-4 text-4xl font-bold">ObjectQL Documentation</h1> | ||
| <p className="text-lg text-muted-foreground"> | ||
| Visit <a href="/docs" className="text-blue-600 hover:underline">/docs</a> to view the documentation | ||
| </p> | ||
| </main> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.