Skip to content

Commit 152a818

Browse files
authored
Merge pull request #137 from deploystackio/main
migration to fumadocs
2 parents 7f8d2cb + ed9f71d commit 152a818

94 files changed

Lines changed: 15186 additions & 4626 deletions

File tree

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: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,19 @@ node_modules/
2323
.idea/
2424
.DS_Store
2525

26-
# Ignore build outputs
27-
dist/
28-
build/
26+
# outputs
27+
.turbo
28+
.next
29+
dist
30+
.contentlayer
31+
.eslintcache
32+
.source
33+
34+
# Next.js cache
35+
.next/cache/
36+
37+
# Fumadocs generated files
38+
.fumadocs/
2939

3040
# Ignore TypeScript compiled outputs
3141
*.tsbuildinfo
@@ -59,3 +69,6 @@ ehthumbs.db
5969
# Tests
6070
coverage/
6171
.jest/
72+
73+
._*.mdx
74+
._*.ts

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: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
import { CustomNavbar } from '@/lib/components/CustomNavbar';
7+
import { getFinalPageTitle } from '@/lib/h1-extractor';
8+
import { readFile } from 'fs/promises';
9+
import { getMDXComponents } from '@/mdx-components';
10+
11+
export default async function Page({
12+
params,
13+
}: {
14+
params: Promise<{ slug?: string[] }>;
15+
}) {
16+
const { slug } = await params;
17+
const page = source.getPage(slug);
18+
19+
if (!page) {
20+
notFound();
21+
}
22+
23+
const MDX = page.data.body;
24+
25+
return (
26+
<DocsPage toc={page.data.toc} full={page.data.full}>
27+
<CustomNavbar />
28+
<DocsBody>
29+
<MDX components={getMDXComponents()} />
30+
</DocsBody>
31+
</DocsPage>
32+
);
33+
}
34+
35+
export async function generateStaticParams() {
36+
return source.generateParams();
37+
}
38+
39+
export async function generateMetadata({
40+
params,
41+
}: {
42+
params: Promise<{ slug?: string[] }>;
43+
}): Promise<Metadata> {
44+
const { slug } = await params;
45+
const page = source.getPage(slug);
46+
47+
if (!page) {
48+
return {};
49+
}
50+
51+
const slugString = slug ? slug.join('/') : '';
52+
const url = getCanonicalUrl(slugString);
53+
54+
// Read the raw MDX file to extract H1 heading
55+
let finalTitle = page.data.title;
56+
try {
57+
// Get the absolute path from the page info
58+
const filePath = page.file.path;
59+
const absolutePath = `./docs/${filePath}`;
60+
const rawContent = await readFile(absolutePath, 'utf-8');
61+
finalTitle = getFinalPageTitle(rawContent, page.data.title);
62+
} catch (error) {
63+
// Fallback to frontmatter title if file reading fails
64+
console.warn('Failed to read MDX file for H1 extraction:', error);
65+
finalTitle = page.data.title;
66+
}
67+
68+
return generatePageMetadata({
69+
title: finalTitle,
70+
description: page.data.description || 'DeployStack Documentation and API Reference',
71+
slug: slugString,
72+
url,
73+
});
74+
}

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+
6+
export default function Layout({ children }: { children: ReactNode }) {
7+
return (
8+
<DocsLayout
9+
{...baseOptions}
10+
tree={source.pageTree}
11+
nav={{
12+
title: 'DeployStack Docs',
13+
url: '/docs',
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+
}

app/global.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Import Fumadocs UI complete styles */
2+
@import 'fumadocs-ui/css/style.css';
3+
4+
/* Custom navbar styling to match main site */
5+
/* Navbar height override removed since navbar is now inside content area */
6+
7+
/* Ensure logo and navigation styling matches main site */
8+
.fd-nav-title {
9+
font-weight: 600;
10+
font-size: 18px;
11+
}
12+
13+
/* Style the login button to match main site */
14+
[data-fumadocs-nav] a[href*="login"] {
15+
background: hsl(var(--primary));
16+
color: hsl(var(--primary-foreground));
17+
border-radius: 9999px;
18+
padding: 0.5rem 1rem;
19+
font-weight: 500;
20+
transition: background-color 0.2s ease;
21+
}
22+
23+
[data-fumadocs-nav] a[href*="login"]:hover {
24+
background: hsl(var(--primary) / 0.9);
25+
}
26+
27+
/* Ensure Documentation link is highlighted when active */
28+
[data-fumadocs-nav] a[href="/docs"][data-active="true"] {
29+
color: hsl(var(--primary));
30+
font-weight: 600;
31+
}
32+
33+
/* Optional: Add your own global styles or font imports here */
34+
/* For example, to set a default font:
35+
body {
36+
font-family: 'Inter', sans-serif; // Make sure to import 'Inter' or your chosen font
37+
}
38+
*/

app/layout.config.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
2+
3+
export const baseOptions: BaseLayoutProps = {
4+
// Navigation bar configuration (now handled by CustomNavbar)
5+
nav: {
6+
title: 'DeployStack Docs',
7+
url: '/docs',
8+
},
9+
10+
// GitHub repository for edit links
11+
githubUrl: 'https://github.com/deploystackio/documentation',
12+
};

0 commit comments

Comments
 (0)