Skip to content

Commit 3777f28

Browse files
Merge pull request #25 from AndronixApp/fumadocs-migration
Fumadocs migration
2 parents 6e5d58b + b3884b7 commit 3777f28

File tree

90 files changed

+9646
-5824
lines changed

Some content is hidden

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

90 files changed

+9646
-5824
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
.next
22
node_modules
3+
.source
4+
.open-next
5+
.dev.vars
6+
.wrangler
7+
cloudflare-env.d.ts

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

app/(docs)/[[...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+
DocsDescription,
6+
DocsTitle,
7+
} from 'fumadocs-ui/page';
8+
import { notFound } from 'next/navigation';
9+
import { getMDXComponents } from '@/mdx-components';
10+
11+
export default async function Page(props: {
12+
params: Promise<{ slug?: string[] }>;
13+
}) {
14+
const params = await props.params;
15+
const page = source.getPage(params.slug);
16+
17+
if (!page) notFound();
18+
19+
const MDX = page.data.body;
20+
21+
return (
22+
<DocsPage toc={page.data.toc} full={page.data.full}>
23+
<DocsTitle>{page.data.title}</DocsTitle>
24+
<DocsDescription>{page.data.description}</DocsDescription>
25+
<DocsBody>
26+
<MDX components={getMDXComponents()} />
27+
</DocsBody>
28+
</DocsPage>
29+
);
30+
}
31+
32+
export async function generateStaticParams() {
33+
return source.generateParams();
34+
}
35+
36+
export async function generateMetadata(props: {
37+
params: Promise<{ slug?: string[] }>;
38+
}) {
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+
}

app/(docs)/layout.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { source } from '@/lib/source';
2+
import { baseOptions } from '@/lib/layout.shared';
3+
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
4+
import type { Metadata } from 'next';
5+
6+
export const metadata: Metadata = {
7+
title: {
8+
template: '%s - Andronix Docs',
9+
default: 'Andronix Documentation',
10+
},
11+
};
12+
13+
export default function RootDocsLayout({ children }: { children: React.ReactNode }) {
14+
return (
15+
<DocsLayout
16+
{...baseOptions()}
17+
tree={source.pageTree}
18+
sidebar={{
19+
defaultOpenLevel: 1,
20+
}}
21+
>
22+
{children}
23+
</DocsLayout>
24+
);
25+
}

app/api/search/route.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { source } from '@/lib/source';
2+
import { createSearchAPI } from 'fumadocs-core/search/server';
3+
4+
export const { GET } = createSearchAPI('advanced', {
5+
indexes: source.getPages().map((page) => ({
6+
title: page.data.title,
7+
structuredData: page.data.structuredData,
8+
id: page.url,
9+
url: page.url,
10+
})),
11+
});

app/global.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@import 'tailwindcss';
2+
@import 'fumadocs-ui/css/neutral.css';
3+
@import 'fumadocs-ui/css/preset.css';
4+
5+
@theme {
6+
/* Orange primary color for light mode */
7+
--color-fd-primary: hsl(24.6, 95%, 53.1%); /* Orange-500 */
8+
--color-fd-primary-foreground: hsl(0, 0%, 100%); /* White text */
9+
}
10+
11+
.dark {
12+
/* Orange primary color for dark mode */
13+
--color-fd-primary: hsl(20.5, 90.2%, 48.2%); /* Orange-500 adjusted for dark */
14+
--color-fd-primary-foreground: hsl(0, 0%, 100%); /* White text */
15+
}

app/layout.tsx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import './global.css';
2+
import { RootProvider } from 'fumadocs-ui/provider';
3+
import { Banner } from 'fumadocs-ui/components/banner';
4+
import { Inter } from 'next/font/google';
5+
6+
const inter = Inter({
7+
subsets: ['latin'],
8+
});
9+
10+
export const metadata = {
11+
title: {
12+
template: '%s - Andronix Docs',
13+
default: 'Andronix Documentation',
14+
},
15+
description: 'Andronix lets you install Linux distributions like Ubuntu, Debian, and Manjaro on non-rooted Android devices. Read our documentation for step-by-step instructions.',
16+
metadataBase: new URL('https://docs.andronix.app'),
17+
openGraph: {
18+
title: 'Andronix Documentation',
19+
description: 'Andronix lets you install Ubuntu, Debian, and Manjaro on non-rooted Android devices. Our documentation provides step-by-step instructions and troubleshooting tips to help you set up your Linux environment quickly and easily. Experience the power of Linux on your mobile device with Andronix.',
20+
url: 'https://docs.andronix.app/',
21+
images: '/og.png',
22+
type: 'website',
23+
},
24+
twitter: {
25+
card: 'summary_large_image',
26+
title: 'Andronix Documentation',
27+
description: 'Andronix lets you install Ubuntu, Debian, and Manjaro on non-rooted Android devices. Our documentation provides step-by-step instructions and troubleshooting tips to help you set up your Linux environment quickly and easily. Experience the power of Linux on your mobile device with Andronix.',
28+
images: '/og.png',
29+
},
30+
};
31+
32+
export default function Layout({ children }: { children: React.ReactNode }) {
33+
return (
34+
<html lang="en" className={inter.className} suppressHydrationWarning>
35+
<body>
36+
<Banner
37+
id="android-12-fix"
38+
variant="rainbow"
39+
rainbowColors={[
40+
'rgba(255,100,0, 0.5)',
41+
'rgba(255,100,0, 0.5)',
42+
'transparent',
43+
'rgba(255,100,0, 0.5)',
44+
'transparent',
45+
'rgba(255,100,0, 0.5)',
46+
'transparent',
47+
]}
48+
>
49+
<div className="flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2 text-center sm:text-left">
50+
<span className="font-medium">🚨 Resolve <strong>Process completed (signal 9)</strong> error</span>
51+
<span className="hidden sm:inline"></span>
52+
<a
53+
href="/android-12/andronix-on-android-12-and-beyond"
54+
className="underline hover:text-white transition-colors"
55+
>
56+
Read the fix
57+
</a>
58+
</div>
59+
</Banner>
60+
<RootProvider>{children}</RootProvider>
61+
</body>
62+
</html>
63+
);
64+
}

build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# Cloudflare Pages build script
3+
# This ensures OpenNext is used instead of the deprecated next-on-pages
4+
5+
echo "Building with OpenNext Cloudflare adapter..."
6+
npx opennextjs-cloudflare build
7+
8+
# Restructure for Cloudflare Pages
9+
echo "Setting up Cloudflare Pages structure..."
10+
11+
# Copy worker to root as _worker.js
12+
cp .open-next/worker.js .open-next/_worker.js
13+
14+
# Move assets to root level (Cloudflare Pages serves from root)
15+
cp -r .open-next/assets/* .open-next/
16+
17+
echo "Build complete!"

components/author.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
export default function Authors({ date, children, by = "by" }) {
1+
export default function Authors({ date, children, by = "by" }: { date: string; children: React.ReactNode; by?: string }) {
22
return (
33
<div className="mt-4 mb-16 text-gray-500 text-sm">
44
{date} {by} {children}
55
</div>
66
);
77
}
88

9-
export function Author({ name, link }) {
9+
export function Author({ name, link }: { name: string; link: string }) {
1010
return (
1111
<span className="after:content-[','] last:after:content-['']">
1212
<a

components/badge.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
export default function Badge({children}) {
2-
3-
return (
4-
<div className={"rounded-full inline-flex text-sm bg-orange-700 bg-opacity-10 w-fit text-orange-400 px-2 py-0.5"}>
5-
<p>{children}</p>
6-
</div>
7-
)
1+
export default function Badge({ children }: { children: React.ReactNode }) {
2+
return (
3+
<span
4+
className={
5+
"rounded-full inline-flex items-center text-sm dark:bg-orange-500/20 bg-opacity-10 dark:text-orange-400 px-2 py-0.5 ml-2 bg-orange-500/10 text-orange-600"
6+
}
7+
>
8+
{children}
9+
</span>
10+
);
811
}

0 commit comments

Comments
 (0)