Skip to content

Commit a811825

Browse files
wolfoo2931claude
andauthored
migrate docs from Jekyll to Fumadocs (#109)
* migrate docs from Jekyll to Fumadocs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * ingnore docs when building main project * fix non existing fumadocs deps * deactivate search bar as it is not working --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent afc0a1b commit a811825

26 files changed

Lines changed: 10825 additions & 174 deletions

‎.github/workflows/pages-pr.yml‎

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,33 @@ on:
44
pull_request:
55
branches: ["main"]
66
paths:
7-
- docs/**
7+
- docs/**
88

99
workflow_dispatch:
1010

1111
permissions:
1212
contents: read
13-
pages: write
14-
id-token: write
15-
16-
concurrency:
17-
group: "pages"
18-
cancel-in-progress: true
1913

2014
jobs:
2115
build:
2216
runs-on: ubuntu-latest
2317
steps:
2418
- name: Checkout
2519
uses: actions/checkout@v5
26-
- name: Setup Ruby
27-
uses: ruby/setup-ruby@v1
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
2823
with:
29-
working-directory: docs
30-
ruby-version: '3.3'
31-
bundler-cache: true
32-
cache-version: 0
33-
- name: Setup Pages
34-
id: pages
35-
uses: actions/configure-pages@v5
36-
- name: Build with Jekyll
24+
node-version: '22'
25+
cache: 'npm'
26+
cache-dependency-path: docs/package-lock.json
27+
28+
- name: Install dependencies
29+
working-directory: docs
30+
run: npm ci
31+
32+
- name: Build with Next.js
3733
working-directory: docs
38-
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
34+
run: npm run build
3935
env:
40-
JEKYLL_ENV: production
36+
NODE_ENV: production

‎.github/workflows/pages.yml‎

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: ["main"]
66
paths:
7-
- docs/**
7+
- docs/**
88

99
workflow_dispatch:
1010

@@ -23,25 +23,31 @@ jobs:
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v5
26-
- name: Setup Ruby
27-
uses: ruby/setup-ruby@v1
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
2829
with:
29-
working-directory: docs
30-
ruby-version: '3.3'
31-
bundler-cache: true
32-
cache-version: 0
33-
- name: Setup Pages
34-
id: pages
35-
uses: actions/configure-pages@v5
36-
- name: Build with Jekyll
30+
node-version: '22'
31+
cache: 'npm'
32+
cache-dependency-path: docs/package-lock.json
33+
34+
- name: Install dependencies
35+
working-directory: docs
36+
run: npm ci
37+
38+
- name: Build with Next.js
3739
working-directory: docs
38-
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
40+
run: npm run build
3941
env:
40-
JEKYLL_ENV: production
42+
NODE_ENV: production
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v5
46+
4147
- name: Upload artifact
4248
uses: actions/upload-pages-artifact@v3
4349
with:
44-
path: docs/_site
50+
path: docs/out
4551

4652
deploy:
4753
environment:

‎docs/.eslintrc.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "next/core-web-vitals",
3+
"rules": {
4+
"import/order": "off",
5+
"import/extensions": "off",
6+
"import/prefer-default-export": "off"
7+
}
8+
}

‎docs/.gitignore‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# dependencies
2+
node_modules
3+
.pnp
4+
.pnp.js
5+
6+
# testing
7+
coverage
8+
9+
# next.js
10+
.next/
11+
out/
12+
13+
# production
14+
build
15+
16+
# misc
17+
.DS_Store
18+
*.pem
19+
20+
# debug
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
# local env files
26+
.env*.local
27+
28+
# vercel
29+
.vercel
30+
31+
# typescript
32+
*.tsbuildinfo
33+
next-env.d.ts
34+
35+
# fumadocs
36+
.source/

‎docs/.ruby-version‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎docs/Gemfile‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎docs/Gemfile.lock‎

Lines changed: 0 additions & 97 deletions
This file was deleted.

‎docs/_config.yml‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { source } from '@/lib/source';
2+
import {
3+
DocsPage,
4+
DocsBody,
5+
DocsTitle,
6+
DocsDescription,
7+
} from 'fumadocs-ui/page';
8+
import { notFound } from 'next/navigation';
9+
import defaultMdxComponents from 'fumadocs-ui/mdx';
10+
11+
interface PageProps {
12+
params: Promise<{ slug?: string[] }>;
13+
}
14+
15+
export default async function Page(props: PageProps) {
16+
const params = await props.params;
17+
const page = source.getPage(params.slug);
18+
19+
if (!page) notFound();
20+
21+
const Mdx = page.data.body;
22+
23+
return (
24+
<DocsPage toc={page.data.toc}>
25+
<DocsTitle>{page.data.title}</DocsTitle>
26+
<DocsDescription>{page.data.description}</DocsDescription>
27+
<DocsBody>
28+
<Mdx components={{ ...defaultMdxComponents }} />
29+
</DocsBody>
30+
</DocsPage>
31+
);
32+
}
33+
34+
export function generateStaticParams() {
35+
return source.generateParams();
36+
}
37+
38+
export async function generateMetadata(props: PageProps) {
39+
const params = await props.params;
40+
const page = source.getPage(params.slug);
41+
42+
if (!page) notFound();
43+
44+
return {
45+
title: page.data.title,
46+
description: page.data.description,
47+
};
48+
}

‎docs/app/global.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

0 commit comments

Comments
 (0)