-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b4b9e15
Showing
20 changed files
with
318 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,28 @@ | ||
# deps | ||
/node_modules | ||
|
||
# generated content | ||
.contentlayer | ||
.content-collections | ||
.source | ||
|
||
# test & build | ||
/coverage | ||
/.next/ | ||
/out/ | ||
/build | ||
*.tsbuildinfo | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
/.pnp | ||
.pnp.js | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# others | ||
.env*.local | ||
.vercel | ||
next-env.d.ts |
This file contains 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,7 @@ | ||
import type { ReactNode } from "react" | ||
import { HomeLayout } from "fumadocs-ui/home-layout" | ||
import { baseOptions } from "../layout.config" | ||
|
||
export default function Layout({ children }: { children: ReactNode }): React.ReactElement { | ||
return <HomeLayout {...baseOptions}>{children}</HomeLayout> | ||
} |
This file contains 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,16 @@ | ||
import Link from "next/link" | ||
|
||
export default function HomePage() { | ||
return ( | ||
<main className="flex h-screen flex-col justify-center text-center"> | ||
<h1 className="mb-4 text-2xl font-bold">Hello World</h1> | ||
<p className="text-fd-muted-foreground"> | ||
You can open{" "} | ||
<Link href="/docs" className="font-semibold text-fd-foreground underline"> | ||
/docs | ||
</Link>{" "} | ||
and see the documentation. | ||
</p> | ||
</main> | ||
) | ||
} |
This file contains 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 "@/app/source" | ||
import { createSearchAPI } from "fumadocs-core/search/server" | ||
|
||
export const { GET } = createSearchAPI("advanced", { | ||
indexes: source.getPages().map(page => ({ | ||
title: page.data.title, | ||
description: page.data.description, | ||
structuredData: page.data.structuredData, | ||
id: page.url, | ||
url: page.url | ||
})) | ||
}) |
This file contains 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 @@ | ||
import { source } from "@/app/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[] } }) { | ||
const page = source.getPage(params.slug) | ||
if (!page) notFound() | ||
|
||
return { | ||
title: page.data.title, | ||
description: page.data.description | ||
} satisfies Metadata | ||
} |
This file contains 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 { DocsLayout } from "fumadocs-ui/layout" | ||
import type { ReactNode } from "react" | ||
import { baseOptions } from "../layout.config" | ||
import { source } from "@/app/source" | ||
|
||
export default function Layout({ children }: { children: ReactNode }) { | ||
return ( | ||
<DocsLayout tree={source.pageTree} {...baseOptions}> | ||
{children} | ||
</DocsLayout> | ||
) | ||
} |
This file contains 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 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,21 @@ | ||
import { type HomeLayoutProps } from "fumadocs-ui/home-layout" | ||
|
||
/** | ||
* Shared layout configurations | ||
* | ||
* you can configure layouts individually from: | ||
* Home Layout: app/(home)/layout.tsx | ||
* Docs Layout: app/docs/layout.tsx | ||
*/ | ||
export const baseOptions: HomeLayoutProps = { | ||
nav: { | ||
title: "My App" | ||
}, | ||
links: [ | ||
{ | ||
text: "Documentation", | ||
url: "/docs", | ||
active: "nested-url" | ||
} | ||
] | ||
} |
This file contains 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,18 @@ | ||
import "./global.css" | ||
import { RootProvider } from "fumadocs-ui/provider" | ||
import { Inter } from "next/font/google" | ||
import type { ReactNode } from "react" | ||
|
||
const inter = Inter({ | ||
subsets: ["latin"] | ||
}) | ||
|
||
export default function Layout({ children }: { children: ReactNode }) { | ||
return ( | ||
<html lang="en" className={inter.className} suppressHydrationWarning> | ||
<body> | ||
<RootProvider>{children}</RootProvider> | ||
</body> | ||
</html> | ||
) | ||
} |
This file contains 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,8 @@ | ||
import { docs, meta } from "@/.source" | ||
import { createMDXSource } from "fumadocs-mdx" | ||
import { loader } from "fumadocs-core/source" | ||
|
||
export const source = loader({ | ||
baseUrl: "/docs", | ||
source: createMDXSource(docs, meta) | ||
}) |
Binary file not shown.
This file contains 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 @@ | ||
--- | ||
title: Hello World | ||
description: Your first document | ||
--- | ||
|
||
Welcome to the docs! You can start writing documents in `/content/docs`. | ||
|
||
## What is Next? | ||
|
||
<Cards> | ||
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" /> | ||
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" /> | ||
</Cards> |
This file contains 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 @@ | ||
--- | ||
title: Components | ||
description: Components | ||
--- | ||
|
||
## Code Block | ||
|
||
```js | ||
console.log('Hello World'); | ||
``` | ||
|
||
## Cards | ||
|
||
<Cards> | ||
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" /> | ||
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" /> | ||
</Cards> |
This file contains 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 @@ | ||
import { createMDX } from 'fumadocs-mdx/next'; | ||
|
||
const withMDX = createMDX(); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const config = { | ||
reactStrictMode: true, | ||
}; | ||
|
||
export default withMDX(config); |
This file contains 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,38 @@ | ||
{ | ||
"name": "docs", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"build": "next build", | ||
"dev": "next dev", | ||
"start": "next start", | ||
"postinstall": "fumadocs-mdx" | ||
}, | ||
"dependencies": { | ||
"next": "^14.2.8", | ||
"fumadocs-ui": "13.4.8", | ||
"fumadocs-core": "13.4.8", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"fumadocs-mdx": "10.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "22.5.4", | ||
"@types/react": "^18.3.5", | ||
"@types/react-dom": "^18.3.0", | ||
"typescript": "^5.5.4", | ||
"@types/mdx": "^2.0.13", | ||
"autoprefixer": "^10.4.20", | ||
"postcss": "^8.4.45", | ||
"tailwindcss": "^3.4.10" | ||
}, | ||
"prettier": { | ||
"plugins": [ | ||
"prettier-plugin-tailwindcss" | ||
], | ||
"useTabs": true, | ||
"semi": false, | ||
"trailingComma": "none", | ||
"printWidth": 120, | ||
"arrowParens": "avoid" | ||
} | ||
} |
This file contains 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,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {} | ||
} | ||
} |
This file contains 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,26 @@ | ||
# [Docs.Learn-Anything.xyz](https://docs.learn-anything.xyz) | ||
|
||
> Docs, API and all things you can know about LA | ||
Published using [Fumadocs](https://fumadocs.vercel.app/). | ||
|
||
## Setup | ||
|
||
Using [Bun](https://bun.sh): | ||
|
||
``` | ||
bun i | ||
``` | ||
|
||
## Run | ||
|
||
``` | ||
bun dev | ||
``` | ||
|
||
## Files | ||
|
||
- [content](content) | ||
- [docs](content/docs) - holds the docs, make or edit `.mdx` files | ||
|
||
[](https://discord.com/invite/bxtD8x6aNF) [](https://x.com/learnanything_) |
This file contains 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,5 @@ | ||
import { defineDocs, defineConfig } from "fumadocs-mdx/config" | ||
|
||
export const { docs, meta } = defineDocs() | ||
|
||
export default defineConfig() |
This file contains 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 { createPreset } from "fumadocs-ui/tailwind-plugin" | ||
|
||
/** @type {import('tailwindcss').Config} */ | ||
export default { | ||
content: [ | ||
"./components/**/*.{ts,tsx}", | ||
"./app/**/*.{ts,tsx}", | ||
"./content/**/*.{md,mdx}", | ||
"./mdx-components.{ts,tsx}", | ||
"./node_modules/fumadocs-ui/dist/**/*.js" | ||
], | ||
presets: [createPreset()] | ||
} |
This file contains 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,29 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"target": "ESNext", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"noEmit": true, | ||
"esModuleInterop": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"incremental": true, | ||
"paths": { | ||
"@/*": ["./*"] | ||
}, | ||
"plugins": [ | ||
{ | ||
"name": "next" | ||
} | ||
] | ||
}, | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], | ||
"exclude": ["node_modules"] | ||
} |