Skip to content

Commit 2a1dfe2

Browse files
tulilirockzSynby
andcommitted
init: first commit!
Signed-off-by: Tulip Blossom <tulilirockz@outlook.com> Co-authored-by: Synby <107513274+Synby@users.noreply.github.com>
0 parents  commit 2a1dfe2

27 files changed

Lines changed: 7783 additions & 0 deletions

.github/workflows/deploy.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Deploy Next.js site to Pages
2+
3+
on:
4+
# Runs on pushes targeting the main branch
5+
push:
6+
branches:
7+
- main
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v6.0.2
30+
31+
- name: Install Node.js
32+
uses: actions/setup-node@v6.3.0
33+
with:
34+
node-version: 22
35+
cache: 'npm'
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
- name: Setup Pages
41+
id: setup_pages
42+
uses: actions/configure-pages@v5
43+
44+
- name: Restore cache
45+
uses: actions/cache@v5
46+
with:
47+
path: |
48+
.next/cache
49+
# Generate a new cache whenever packages or source files change.
50+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
51+
# If source files changed but packages didn't, rebuild from a prior cache.
52+
restore-keys: |
53+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
54+
55+
- name: Build with Next.js
56+
run: pnpm run build
57+
env:
58+
PAGES_BASE_PATH: ${{ steps.setup_pages.outputs.base_path }}
59+
60+
- name: Upload artifact
61+
uses: actions/upload-pages-artifact@v4
62+
with:
63+
path: ./out
64+
65+
deploy:
66+
environment:
67+
name: github-pages
68+
url: ${{ steps.deployment.outputs.page_url }}
69+
runs-on: ubuntu-latest
70+
needs: build
71+
steps:
72+
- name: Deploy to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v4.0.5

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# deps
2+
/node_modules
3+
4+
# generated content
5+
.source
6+
7+
# test & build
8+
/coverage
9+
/.next/
10+
/out/
11+
/build
12+
*.tsbuildinfo
13+
14+
# misc
15+
.DS_Store
16+
*.pem
17+
/.pnp
18+
.pnp.js
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
# others
24+
.env*.local
25+
.vercel
26+
next-env.d.ts

LICENSE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright 2026 @zirconium-dev
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# zirconium-docs
2+
3+
This is a Next.js application generated with
4+
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
5+
6+
It is a Next.js app with [Static Export](https://nextjs.org/docs/app/guides/static-exports) configured.
7+
8+
Run development server:
9+
10+
```bash
11+
npm run dev
12+
# or
13+
pnpm dev
14+
# or
15+
yarn dev
16+
```
17+
18+
Open http://localhost:3000 with your browser to see the result.
19+
20+
## Explore
21+
22+
In the project, you can see:
23+
24+
- `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content.
25+
- `lib/layout.shared.tsx`: Shared options for layouts, optional but preferred to keep.
26+
27+
| Route | Description |
28+
| ------------------------- | ------------------------------------------------------ |
29+
| `app/(home)` | The route group for your landing page and other pages. |
30+
| `app/docs` | The documentation layout and pages. |
31+
| `app/api/search/route.ts` | The Route Handler for search. |
32+
33+
### Fumadocs MDX
34+
35+
A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.
36+
37+
Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details.
38+
39+
## Learn More
40+
41+
To learn more about Next.js and Fumadocs, take a look at the following
42+
resources:
43+
44+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
45+
features and API.
46+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
47+
- [Fumadocs](https://fumadocs.dev) - learn about Fumadocs

app/(home)/layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { HomeLayout } from 'fumadocs-ui/layouts/home';
2+
import { baseOptions } from '@/lib/layout.shared';
3+
4+
export default function Layout({ children }: LayoutProps<'/'>) {
5+
return <HomeLayout {...baseOptions()}>{children}</HomeLayout>;
6+
}

app/(home)/page.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Link from 'next/link';
2+
3+
export default function HomePage() {
4+
return (
5+
<div className="flex flex-col justify-center text-center flex-1">
6+
<h1 className="text-2xl font-bold mb-4">Hello World</h1>
7+
<p>
8+
You can open{' '}
9+
<Link href="/docs" className="font-medium underline">
10+
/docs
11+
</Link>{' '}
12+
and see the documentation.
13+
</p>
14+
</div>
15+
);
16+
}

app/api/search/route.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { source } from '@/lib/source';
2+
import { createFromSource } from 'fumadocs-core/search/server';
3+
4+
export const revalidate = false;
5+
6+
export const { staticGET: GET } = createFromSource(source, {
7+
// https://docs.orama.com/docs/orama-js/supported-languages
8+
language: 'english',
9+
});

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

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

app/docs/layout.tsx

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 { DocsLayout } from 'fumadocs-ui/layouts/docs';
3+
import { baseOptions } from '@/lib/layout.shared';
4+
5+
export default function Layout({ children }: LayoutProps<'/docs'>) {
6+
return (
7+
<DocsLayout tree={source.getPageTree()} {...baseOptions()}>
8+
{children}
9+
</DocsLayout>
10+
);
11+
}

app/global.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import 'tailwindcss';
2+
@import 'fumadocs-ui/css/dusk.css';
3+
@import 'fumadocs-ui/css/preset.css';

0 commit comments

Comments
 (0)