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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ dist
docs/.vitepress/cache
docs/.vitepress/dist

# Fumadocs / Next.js
apps/site/.next
apps/site/out
apps/site/.source

# Database
*.sqlite3
*.db
Expand Down
3 changes: 3 additions & 0 deletions apps/site/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions apps/site/.gitignore
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
40 changes: 40 additions & 0 deletions apps/site/app/docs/[[...slug]]/page.tsx
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,
};
}
12 changes: 12 additions & 0 deletions apps/site/app/docs/layout.tsx
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>
);
}
3 changes: 3 additions & 0 deletions apps/site/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
17 changes: 17 additions & 0 deletions apps/site/app/layout.config.tsx
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';
Comment thread
github-code-quality[bot] marked this conversation as resolved.
Fixed

export const baseOptions: Omit<DocsLayoutProps, 'tree'> = {
nav: {
title: 'ObjectQL',
},
links: [
{
text: 'Documentation',
url: '/docs',
active: 'nested-url',
},
],
githubUrl: 'https://github.com/objectstack-ai/objectql',
};
13 changes: 13 additions & 0 deletions apps/site/app/layout.tsx
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>
);
}
10 changes: 10 additions & 0 deletions apps/site/app/page.tsx
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>
);
}
Loading
Loading