Skip to content
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

37 changes: 20 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
# build output
dist/
# generated types
.astro/
# deps
/node_modules

# dependencies
node_modules/
# generated content
.source

# logs
# test & build
/coverage
/.next/
/out/
/build
*.tsbuildinfo

# misc
.DS_Store
*.pem
/.pnp
.pnp.js
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

bun.lockb
# others
.env*.local
.vercel
next-env.d.ts
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierrc.js

This file was deleted.

8 changes: 0 additions & 8 deletions .vscode/extensions.json

This file was deleted.

11 changes: 0 additions & 11 deletions .vscode/launch.json

This file was deleted.

4 changes: 0 additions & 4 deletions .vscode/settings.json

This file was deleted.

53 changes: 41 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
# Ultramarine Linux Wiki
# wiki

Welcome to the source repository behind the [Ultramarine Wiki]! We welcome any contributions and
you may freely send pull requests to this repository if you would like to modify any of the
content here!
This is a Next.js application generated with
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).

## Translations
It is a Next.js app with [Static Export](https://nextjs.org/docs/app/guides/static-exports) configured.

If you'd like to translate for a new language:
Run development server:

1. Go to `src/consts.ts` to add a new language into `KNOWN_LANGUAGES`
2. Copy everything from `src/content/docs/en` to `src/content/docs/<your_language_code>`[^1]
3. Add pages into `SIDEBAR` in `src/consts.ts`
4. Start translating!
```bash
npm run dev
# or
pnpm dev
# or
yarn dev
```

[^1]: We encourage you to use a generic language code without limiting the region.
Open http://localhost:3000 with your browser to see the result.

[Ultramarine Wiki]: https://wiki.ultramarine-linux.org
## Explore

In the project, you can see:

- `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content.
- `lib/layout.shared.tsx`: Shared options for layouts, optional but preferred to keep.

| Route | Description |
| ------------------------- | ------------------------------------------------------ |
| `app/(home)` | The route group for your landing page and other pages. |
| `app/docs` | The documentation layout and pages. |
| `app/api/search/route.ts` | The Route Handler for search. |

### Fumadocs MDX

A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.

Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details.

## Learn More

To learn more about Next.js and Fumadocs, take a look at the following
resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Fumadocs](https://fumadocs.dev) - learn about Fumadocs
6 changes: 6 additions & 0 deletions app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/lib/layout.shared';

export default function Layout({ children }: LayoutProps<'/'>) {
return <HomeLayout {...baseOptions()}>{children}</HomeLayout>;
}
125 changes: 125 additions & 0 deletions app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import { Card, Cards } from "fumadocs-ui/components/card";
import { source } from "@/lib/source";
import { icons as lucideIcons } from "lucide-react";
import { createElement } from "react";

const START = [
{
title: "Get Started",
href: "/docs/get-started",
slug: "get-started",
icon: "CirclePower",
},
{
title: "Using Ultramarine",
href: "/docs/usage",
slug: "usage",
icon: "Sailboat",
},
] as const;

const LEARN = [
{
title: "Anywhere",
href: "/docs/anywhere",
slug: "anywhere",
icon: "Cpu",
},
{
title: "Join the Community",
href: "/docs/community",
slug: "community",
icon: "MessageCircleHeart",
},
{
title: "Linux Concepts",
href: "/docs/linux",
slug: "linux",
icon: "GraduationCap",
},
{
title: "About Ultramarine",
href: "/docs/about",
slug: "about",
icon: "PawPrint",
},
] as const;

function getIcon(iconName: string | undefined): React.ReactNode | undefined {
if (!iconName) return undefined;
if (iconName in lucideIcons) {
return createElement(lucideIcons[iconName as keyof typeof lucideIcons]);
}
return undefined;
}

export default function HomePage() {
const start = START.map((section) => ({
...section,
description: source.getPage([section.slug])?.data.description ?? "",
icon: getIcon(section.icon),
}));
const learn = LEARN.map((section) => ({
...section,
description: source.getPage([section.slug])?.data.description ?? "",
icon: getIcon(section.icon),
}));

return (
<div className="flex flex-col flex-1 container mx-auto max-w-5xl p-8 prose">
<header>
<h1>Welcome to the Ultramarine Wiki!</h1>
<p></p>
</header>

<section>
<h2>Get Started and Settled</h2>
<Cards>
{start.map((section) => (
<Card
key={section.slug}
title={section.title}
href={section.href}
description={section.description}
icon={section.icon}
/>
))}
</Cards>
</section>

<section>
<h2>Learn More</h2>
<Cards>
{learn.map((section) => (
<Card
key={section.slug}
title={section.title}
href={section.href}
description={section.description}
icon={section.icon}
/>
))}
</Cards>
</section>

<section>
<h2>Community</h2>
<p>
Stuck? Have a question? Join our{" "}
<a href="https://fyralabs.com/discord">Discord</a> community. Our
community is friendly and always willing to help.
</p>
</section>

<section>
<h2>Contributing</h2>
<p>
This site is libre software and contributions are welcome. Check out
the{" "}
<a href="https://github.com/FyraLabs/devdocs">GitHub repository</a>{" "}
for more information.
</p>
</section>
</div>
);
}
9 changes: 9 additions & 0 deletions app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { source } from '@/lib/source';
import { createFromSource } from 'fumadocs-core/search/server';

export const revalidate = false;

export const { staticGET: GET } = createFromSource(source, {
// https://docs.orama.com/docs/orama-js/supported-languages
language: 'english',
});
60 changes: 60 additions & 0 deletions app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { getPageImage, source } from "@/lib/source";
import {
DocsBody,
DocsDescription,
DocsPage,
DocsTitle,
} from "fumadocs-ui/layouts/docs/page";
import { notFound } from "next/navigation";
import { getMDXComponents } from "@/mdx-components";
import type { Metadata } from "next";
import { createRelativeLink } from "fumadocs-ui/mdx";

export default async function Page(props: PageProps<"/[...slug]">) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

const MDX = page.data.body;

return (
<DocsPage
toc={page.data.toc}
full={page.data.full}
tableOfContent={{
style: "clerk",
}}
>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX
components={getMDXComponents({
// this allows you to link to other pages with relative file paths
a: createRelativeLink(source, page),
})}
/>
</DocsBody>
</DocsPage>
);
}

export async function generateStaticParams() {
return source.generateParams();
}

export async function generateMetadata(
props: PageProps<"/[...slug]">,
): Promise<Metadata> {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

return {
title: page.data.title,
description: page.data.description,
openGraph: {
images: getPageImage(page).url,
},
};
}
11 changes: 11 additions & 0 deletions app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/lib/layout.shared';

export default function Layout({ children }: LayoutProps<'/docs'>) {
return (
<DocsLayout tree={source.getPageTree()} {...baseOptions()}>
{children}
</DocsLayout>
);
}
3 changes: 3 additions & 0 deletions app/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import "tailwindcss";
@import "fumadocs-ui/css/neutral.css";
@import "fumadocs-ui/css/preset.css";
12 changes: 12 additions & 0 deletions app/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading