Skip to content

Commit b6a942a

Browse files
author
Lasim
committed
migration to fumadocs
1 parent 655b288 commit b6a942a

72 files changed

Lines changed: 11098 additions & 4562 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
- name: Run Lint Links
3737
run: npm run lint:links
3838

39+
- name: Run Lint Links
40+
run: npm run build
41+
3942
release:
4043
name: Run Release
4144
runs-on: ubuntu-latest

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ node_modules/
2323
.idea/
2424
.DS_Store
2525

26-
# Ignore build outputs
26+
# Next.js build outputs
27+
.next/
28+
out/
2729
dist/
2830
build/
2931

32+
# Next.js cache
33+
.next/cache/
34+
35+
# Vercel deployment outputs
36+
.vercel/
37+
38+
# Fumadocs generated files
39+
.fumadocs/
40+
3041
# Ignore TypeScript compiled outputs
3142
*.tsbuildinfo
3243

.source/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// @ts-nocheck -- skip type checking
2+
import * as docs_2 from "../docs/docker-to-iac/index.mdx?collection=docs&hash=1749400994400"
3+
import * as docs_1 from "../docs/deploystack/index.mdx?collection=docs&hash=1749400994400"
4+
import * as docs_0 from "../docs/index.mdx?collection=docs&hash=1749400994400"
5+
import { _runtime } from "fumadocs-mdx"
6+
import * as _source from "../source.config"
7+
export const docs = _runtime.docs<typeof _source.docs>([{ info: {"path":"index.mdx","absolutePath":"/Volumes/T9_1/Git/deploy.my/documentation/docs/index.mdx"}, data: docs_0 }, { info: {"path":"deploystack/index.mdx","absolutePath":"/Volumes/T9_1/Git/deploy.my/documentation/docs/deploystack/index.mdx"}, data: docs_1 }, { info: {"path":"docker-to-iac/index.mdx","absolutePath":"/Volumes/T9_1/Git/deploy.my/documentation/docs/docker-to-iac/index.mdx"}, data: docs_2 }], [{"info":{"path":"deploystack/meta.json","absolutePath":"/Volumes/T9_1/Git/deploy.my/documentation/docs/deploystack/meta.json"},"data":{"title":"DeployStack","description":"Documentation for DeployStack","root":true,"icon":"DeployStackLogo"}}, {"info":{"path":"docker-to-iac/meta.json","absolutePath":"/Volumes/T9_1/Git/deploy.my/documentation/docs/docker-to-iac/meta.json"},"data":{"title":"docker-to-iac","description":"docker-to-iac module","root":true,"icon":"Container"}}])

.source/source.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// source.config.ts
2+
import { defineDocs } from "fumadocs-mdx/config";
3+
var docs = defineDocs({
4+
// Directory of documents, relative to the project root.
5+
// We are using the existing 'docs' folder.
6+
dir: "docs"
7+
});
8+
export {
9+
docs
10+
};

README.md

Lines changed: 78 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,122 @@
11
# DeployStack Documentation
22

3-
This repository contains the official documentation for the DeployStack ecosystem. Visit [deploystack.io](https://deploystack.io) to learn more about our platform.
3+
This repository contains the official documentation site for the [DeployStack](https://deploystack.io/docs/) ecosystem, built with [fumadocs](https://fumadocs.vercel.app/). Visit [deploystack.io](https://deploystack.io) to learn more about our platform.
44

5-
## Project Structure
5+
## Technology Stack
6+
7+
- **Framework**: Next.js 15 with App Router
8+
- **Documentation**: Fumadocs for modern docs experience
9+
- **Content**: MDX (Markdown + React components)
10+
- **Styling**: Tailwind CSS
11+
- **Language**: TypeScript
612

7-
Key directories in this repository:
13+
## Project Structure
814

915
```text
1016
.
11-
├── docs/
12-
│ ├── assets/
13-
│ │ └── images/
14-
│ ├── deploystack/
15-
│ ├── docker-to-iac/
16-
│ └── sidebar-links.json
17-
└── markdown-rules/
17+
├── docs/ # Documentation content (MDX files)
18+
│ ├── deploystack/ # DeployStack documentation
19+
│ ├── docker-to-iac/ # Docker-to-IaC documentation
20+
│ └── assets/ # Images and static assets
21+
├── app/ # Next.js app directory (fumadocs framework)
22+
├── lib/ # Documentation utilities & components
23+
└── source.config.ts # Fumadocs configuration
24+
```
25+
26+
**Note**: The `app/` directory contains the fumadocs framework setup and should not be modified for content changes. All documentation content goes in the `docs/` directory.
27+
28+
## Development Setup
29+
30+
```bash
31+
# Install dependencies
32+
npm ci
33+
34+
# Start documentation development server (http://localhost:3000)
35+
npm run dev
36+
37+
# Build documentation site for production
38+
npm run build
39+
40+
# Start production server
41+
npm run start
42+
43+
# Validate documentation quality
44+
npm run lint:md # Markdown linting
45+
npm run lint:links # Link validation
1846
```
1947

2048
## Contributing Guidelines
2149

22-
### Documentation Standards
50+
### Writing Documentation
2351

24-
1. Store all documentation files in the `./docs` directory
25-
2. Place images in `./docs/assets/images`
26-
3. Use absolute links for all references:
27-
- Documentation: `/docs/docker-to-iac/index.md`
52+
1. **Content Format**: Write all documentation in MDX format (`.mdx` files)
53+
2. **Location**: Store all content in the `docs/` directory
54+
3. **Navigation**: Use `meta.json` files in each directory to control navigation structure
55+
4. **Assets**: Place images in `docs/assets/images/` with appropriate subdirectories
56+
5. **Links**: Use absolute paths for all references:
57+
- Documentation: `/docs/docker-to-iac/`
2858
- Images: `/docs/assets/images/example.png`
2959

30-
### Adding New Content
60+
### Navigation Structure
3161

32-
When creating new documentation:
62+
Fumadocs automatically generates navigation from your file structure and `meta.json` files:
3363

34-
1. Add new pages to the appropriate subdirectory in `./docs`
35-
2. Follow the established file naming conventions
36-
3. Ensure all links are absolute paths
37-
4. Include necessary sidebar entries in `sidebar-links.json`
64+
- Each directory can have a `meta.json` file to configure its appearance in navigation
65+
- File-based routing: `docs/deploystack/index.mdx` becomes `/docs/deploystack`
66+
- Nested directories create hierarchical navigation
3867

39-
### Asset Management
68+
### Adding New Content
4069

41-
For diagrams and architectural images (optional):
70+
1. Create new `.mdx` files in the appropriate `docs/` subdirectory
71+
2. Add or update `meta.json` files to control navigation
72+
3. Follow established naming conventions
73+
4. Ensure all links use absolute paths
74+
5. Test locally with `npm run dev`
4275

43-
1. Use [draw.io](https://app.diagrams.net/) for creating diagrams
44-
2. Export as PNG with included diagram data for future editing
45-
3. Place files in the appropriate subdirectory under `./docs/assets/images`
76+
### Asset Management
4677

47-
If you want to upload images, please minify them.
78+
For diagrams and images:
79+
80+
1. Use [drow.io](https://app.diagrams.net/) for creating diagrams
81+
2. Export as PNG or WebP format
82+
3. Optimize images for web (compress file sizes)
83+
4. Place files in appropriate subdirectories under `docs/assets/images/`
4884

4985
## Deployment Process
5086

51-
Our deployment process uses two main branches:
87+
Our deployment uses a two-branch workflow:
5288

53-
- `main`: Development branch
54-
- `prod`: Production branch
89+
- **`main`**: Development branch for content updates and testing
90+
- **`prod`**: Production branch that deploys to [deploystack.io/docs](https://deploystack.io/docs)
5591

5692
### Workflow
5793

5894
1. Create feature branches from `main`
5995
2. Submit pull requests to `main`
6096
3. After approval and merge to `main`, changes are automatically validated
61-
4. Merge to `prod` to deploy to [deploystack.io/docs](https://deploystack.io/docs)
97+
4. Merge to `prod` to deploy to production
6298

6399
### Continuous Integration
64100

65101
The CI pipeline includes:
66102

67-
- Markdown linting
68-
- Link validation
69-
- Automatic versioning using semantic release
103+
- Markdown linting and validation
104+
- Link checking to prevent broken links
105+
- Automatic fumadocs build verification
70106
- Production deployment triggers
71107

72-
## Development Setup
73-
74-
```bash
75-
# Install dependencies
76-
npm ci
77-
78-
# Run markdown linting
79-
npm run lint:md
80-
81-
# Check for dead links
82-
npm run lint:links
83-
```
84-
85-
## Release Process
108+
## Local Development
86109

87-
Releases are managed automatically through our CI/CD pipeline. When merging to the production branch:
110+
When running `npm run dev`, the documentation site will be available at `http://localhost:3000`. The fumadocs framework provides:
88111

89-
1. Changes are validated
90-
2. Documentation is built
91-
3. Content is deployed to [deploystack.io/docs](https://deploystack.io/docs)
112+
- Hot reloading for content changes
113+
- Automatic navigation generation
114+
- Built-in search functionality
115+
- Responsive design
116+
- Dark/light mode support
92117

93118
## 💬 Need Help?
94119

95120
- 📚 Check our [Documentation](https://deploystack.io/docs)
96121
- 🎯 Report issues on [GitHub](https://github.com/deploystackio/documentation/issues)
97-
- 📧 Use Discord to chat with us at [https://discord.gg/UjFWwByB](https://discord.gg/UjFWwByB)
122+
- 📧 Join our Discord at [https://discord.gg/UjFWwByB](https://discord.gg/UjFWwByB)

app/api/search/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { source } from '../../../lib/source';
2+
import { createFromSource } from 'fumadocs-core/search/server';
3+
4+
export const { GET } = createFromSource(source);

app/docs/[[...slug]]/page.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import type { Metadata } from 'next';
2+
import { DocsPage, DocsBody } from 'fumadocs-ui/page';
3+
import { notFound } from 'next/navigation';
4+
import { source } from '@/lib/source';
5+
import { generatePageMetadata, getCanonicalUrl } from '@/lib/seo-utils';
6+
7+
export default async function Page({
8+
params,
9+
}: {
10+
params: Promise<{ slug?: string[] }>;
11+
}) {
12+
const { slug } = await params;
13+
const page = source.getPage(slug);
14+
15+
if (!page) {
16+
notFound();
17+
}
18+
19+
const MDX = page.data.body;
20+
21+
return (
22+
<DocsPage toc={page.data.toc} full={page.data.full}>
23+
<DocsBody>
24+
<h1>{page.data.title}</h1>
25+
<MDX />
26+
</DocsBody>
27+
</DocsPage>
28+
);
29+
}
30+
31+
export async function generateStaticParams() {
32+
return source.generateParams();
33+
}
34+
35+
export async function generateMetadata({
36+
params,
37+
}: {
38+
params: Promise<{ slug?: string[] }>;
39+
}): Promise<Metadata> {
40+
const { slug } = await params;
41+
const page = source.getPage(slug);
42+
43+
if (!page) {
44+
return {};
45+
}
46+
47+
const slugString = slug ? slug.join('/') : '';
48+
const url = getCanonicalUrl(slugString);
49+
50+
return generatePageMetadata({
51+
title: page.data.title,
52+
description: page.data.description || 'DeployStack Documentation and API Reference',
53+
slug: slugString,
54+
url,
55+
});
56+
}

app/docs/layout.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
2+
import type { ReactNode } from 'react';
3+
import { baseOptions } from '../layout.config';
4+
import { source } from '../../lib/source';
5+
import { CustomNavbar } from '../../lib/components/CustomNavbar';
6+
7+
export default function Layout({ children }: { children: ReactNode }) {
8+
return (
9+
<DocsLayout
10+
{...baseOptions}
11+
tree={source.pageTree}
12+
nav={{
13+
component: <CustomNavbar />,
14+
}}
15+
sidebar={{
16+
defaultOpenLevel: 1,
17+
}}
18+
>
19+
{children}
20+
</DocsLayout>
21+
);
22+
}

app/docs/sitemap.xml/route.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { source } from '@/lib/source';
2+
import { getCanonicalUrl } from '@/lib/seo-utils';
3+
4+
export async function GET() {
5+
const pages = source.getPages();
6+
7+
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
8+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
9+
${pages
10+
.map((page) => {
11+
const url = getCanonicalUrl(page.url);
12+
return ` <url>
13+
<loc>${url}</loc>
14+
<lastmod>${new Date().toISOString()}</lastmod>
15+
<changefreq>weekly</changefreq>
16+
<priority>0.8</priority>
17+
</url>`;
18+
})
19+
.join('\n')}
20+
</urlset>`;
21+
22+
return new Response(sitemap, {
23+
headers: {
24+
'Content-Type': 'application/xml',
25+
},
26+
});
27+
}

0 commit comments

Comments
 (0)