mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-25 05:46:18 +00:00
docs: vendor the documentation site into the monorepo
Fold the standalone 3x-ui-docs project (Next.js 16 + Fumadocs, deployed to docs.sanaei.dev) into docs/ so the panel and its documentation share a single source of truth, the way sing-box keeps its docs in-tree. The old repo becomes redundant and can be retired. - Import the full site under docs/ (app, components, content, lib, public, scripts, config). The self-contained pnpm project sits alongside the existing engineering notes with no filename collisions. - Re-point "Edit on GitHub" links from MHSanaei/3x-ui-docs to this repo's docs/content/docs path (docs/lib/shared.ts, docs/app/.../page.tsx). - Add docs-ci.yml and docs-deploy.yml under .github/workflows/, scoped to docs/** and run with working-directory: docs, since GitHub only runs workflows from the repo-root .github/. deploy-static.yml's GitHub Pages publish (CNAME docs.sanaei.dev) carries over unchanged. Follow-up (outside this commit): attach the docs.sanaei.dev custom domain to this repository's Pages (or set the Vercel project's root directory to docs), confirm the site is live from the monorepo, then delete MHSanaei/3x-ui-docs.
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
|
||||
import { Heart } from 'lucide-react';
|
||||
import { Logo } from '@/components/logo';
|
||||
import { TelegramIcon } from '@/components/icons';
|
||||
import { appName, productRepoUrl, telegramChannel, telegramChannelUrl, donateUrl } from './shared';
|
||||
import { getSiteMessages } from './site-i18n';
|
||||
|
||||
// Build locale-aware shared layout options. With `hideLocale: 'default-locale'`,
|
||||
// English URLs have no prefix while other locales are prefixed (`/fa`, `/ru`, `/zh`).
|
||||
export function baseOptions(lang: string): BaseLayoutProps {
|
||||
const prefix = lang === 'en' ? '' : `/${lang}`;
|
||||
const m = getSiteMessages(lang);
|
||||
|
||||
return {
|
||||
nav: {
|
||||
title: (
|
||||
<span className="inline-flex items-center gap-2 font-semibold">
|
||||
<Logo className="h-6" />
|
||||
{appName}
|
||||
</span>
|
||||
),
|
||||
url: `${prefix}/`,
|
||||
},
|
||||
githubUrl: productRepoUrl,
|
||||
links: [
|
||||
{
|
||||
text: m.documentation,
|
||||
url: `${prefix}/docs`,
|
||||
active: 'nested-url',
|
||||
},
|
||||
{
|
||||
type: 'icon',
|
||||
label: `Telegram channel (@${telegramChannel})`,
|
||||
icon: <TelegramIcon />,
|
||||
text: 'Telegram',
|
||||
url: telegramChannelUrl,
|
||||
external: true,
|
||||
},
|
||||
// Compact heart icon in the top nav bars (home + docs).
|
||||
{
|
||||
type: 'icon',
|
||||
on: 'nav',
|
||||
label: m.donate,
|
||||
icon: <Heart />,
|
||||
text: m.donate,
|
||||
url: donateUrl,
|
||||
external: true,
|
||||
},
|
||||
// Prominent labelled entry in the docs sidebar / mobile menu.
|
||||
{
|
||||
type: 'main',
|
||||
on: 'menu',
|
||||
icon: <Heart />,
|
||||
text: m.donate,
|
||||
url: donateUrl,
|
||||
external: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user