Skip to content

Commit 71131a7

Browse files
committed
rename to content
1 parent 4d214ea commit 71131a7

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ Open http://localhost:3000 to view the docs.
2929

3030
## Writing Documentation
3131

32-
Content is located in `content/docs`. We use **MDX** (Markdown + React components).
32+
Content is located in `content/`. We use **MDX** (Markdown + React components).
3333

3434
### File Structure
3535

36-
* `content/docs/*.mdx`: The actual documentation pages. The file path determines the URL.
36+
* `content/*.mdx`: The actual documentation pages. The file path determines the URL.
3737
* `app/source.ts`: Configuration for the content source adapter.
3838

3939
### Adding a Page
4040

41-
Create a new `.mdx` file in `content/docs`. Every file requires a frontmatter block at the top:
41+
Create a new `.mdx` file in `content/`. Every file requires a frontmatter block at the top:
4242

4343
```mdx
4444
---
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getMDXComponents } from '@/mdx-components';
1010
import type { Metadata } from 'next';
1111
import { createRelativeLink } from 'fumadocs-ui/mdx';
1212

13-
export default async function Page(props: PageProps<'/docs/[[...slug]]'>) {
13+
export default async function Page(props: PageProps<'/content/[[...slug]]'>) {
1414
const params = await props.params;
1515
const page = source.getPage(params.slug);
1616
if (!page) notFound();
@@ -38,7 +38,7 @@ export async function generateStaticParams() {
3838
}
3939

4040
export async function generateMetadata(
41-
props: PageProps<'/docs/[[...slug]]'>,
41+
props: PageProps<'/content/[[...slug]]'>,
4242
): Promise<Metadata> {
4343
const params = await props.params;
4444
const page = source.getPage(params.slug);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { source } from '@/lib/source';
22
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
33
import { baseOptions } from '@/lib/layout.shared';
44

5-
export default function Layout({ children }: LayoutProps<'/docs'>) {
5+
export default function Layout({ children }: LayoutProps<'/content'>) {
66
return (
77
<DocsLayout tree={source.pageTree} {...baseOptions()}>
88
{children}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const revalidate = false;
77

88
export async function GET(
99
_req: Request,
10-
{ params }: RouteContext<'/og/docs/[...slug]'>,
10+
{ params }: RouteContext<'/og/content/[...slug]'>,
1111
) {
1212
const { slug } = await params;
1313
const page = source.getPage(slug.slice(0, -1));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Hello World
33
description: Your first document
44
---
55

6-
Welcome to the docs! You can start writing documents in `/content/docs`.
6+
Welcome to the docs! You can start writing documents in `/content/`.
77

88
## What is Next?
99

File renamed without changes.

lib/source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
44

55
// See https://fumadocs.dev/docs/headless/source-api for more info
66
export const source = loader({
7-
baseUrl: '/docs',
7+
baseUrl: '/content',
88
source: docs.toFumadocsSource(),
99
plugins: [lucideIconsPlugin()],
1010
});
@@ -14,7 +14,7 @@ export function getPageImage(page: InferPageType<typeof source>) {
1414

1515
return {
1616
segments,
17-
url: `/og/docs/${segments.join('/')}`,
17+
url: `/og/content/${segments.join('/')}`,
1818
};
1919
}
2020

next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const config = {
1010
return [
1111
{
1212
source: '/',
13-
destination: '/docs',
13+
destination: '/content',
1414
permanent: false,
1515
},
1616
];

source.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
// You can customise Zod schemas for frontmatter and `meta.json` here
99
// see https://fumadocs.dev/docs/mdx/collections
1010
export const docs = defineDocs({
11-
dir: 'content/docs',
11+
dir: 'content',
1212
docs: {
1313
schema: frontmatterSchema,
1414
postprocess: {

0 commit comments

Comments
 (0)