mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-06-14 20:36:59 +00:00
complete i18n migration to /[locale]/ with EN+ES content
Full rewrite of the docs site under app/[locale]/ with next-intl in localePrefix:"always" mode. Every page now exists at both /en/<path> and /es/<path>; the root / shows a meta-refresh + JS redirect to /<defaultLocale>/ so GitHub Pages serves something on the apex URL. Highlights: - 107 doc pages migrated to file-per-page JSON namespaces under messages/en/ and messages/es/. Spanish content is fully translated (no copy-of-English placeholders). - New documentation for the Active Suppressions section in the Settings tab and the per-event Dismiss dropdown in the Health Monitor modal. - New screenshots: dismiss-duration-dropdown.png and an updated health-suppression-settings.png. - Pagefind integrated for client-side search; index is built on every CI deploy (not committed). - RSS feeds: per-locale at /<locale>/rss.xml plus root /rss.xml for backward compat. - Removed the dead app/[locale]/guides/[slug]/ route — every guide now has its own static page and no markdown source remains. - Fixed orphan link /guides/nvidia -> /guides/nvidia-manual in docs/hardware/nvidia-host. - Removed obsolete components (footer2, calendar, drawer). Verified locally with `npm ci && npm run build`: 2804 files in out/, 231 pages indexed by pagefind, root redirect intact, both locale roots and the new Active Suppressions docs render OK.
This commit is contained in:
85
web/app/[locale]/docs/about/code-of-conduct/page.tsx
Normal file
85
web/app/[locale]/docs/about/code-of-conduct/page.tsx
Normal file
@@ -0,0 +1,85 @@
|
||||
import type { Metadata } from "next"
|
||||
import { getTranslations, setRequestLocale } from "next-intl/server"
|
||||
import fs from "fs"
|
||||
import path from "path"
|
||||
import { remark } from "remark"
|
||||
import html from "remark-html"
|
||||
import * as gfm from "remark-gfm"
|
||||
import React from "react"
|
||||
import parse from "html-react-parser"
|
||||
import CopyableCode from "@/components/CopyableCode"
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {
|
||||
const { locale } = await params
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.codeOfConduct.meta" })
|
||||
return {
|
||||
title: t("title"),
|
||||
description: t("description"),
|
||||
openGraph: {
|
||||
title: t("ogTitle"),
|
||||
description: t("ogDescription"),
|
||||
type: "article",
|
||||
url: "https://macrimi.github.io/ProxMenux/docs/about/code-of-conduct",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
async function getCodeOfConductContent(notFoundMsg: string, loadFailedMsg: string) {
|
||||
try {
|
||||
const codeOfConductPath = path.join(process.cwd(), "..", "CODE_OF_CONDUCT.md")
|
||||
|
||||
if (!fs.existsSync(codeOfConductPath)) {
|
||||
console.error("CODE_OF_CONDUCT.md file not found.")
|
||||
return `<p class='text-red-600'>${notFoundMsg}</p>`
|
||||
}
|
||||
|
||||
const fileContents = fs.readFileSync(codeOfConductPath, "utf8")
|
||||
|
||||
const result = await remark()
|
||||
.use(gfm.default || gfm)
|
||||
.use(html)
|
||||
.process(fileContents)
|
||||
|
||||
return result.toString()
|
||||
} catch (error) {
|
||||
console.error("Error reading the CODE_OF_CONDUCT.md file", error)
|
||||
return `<p class='text-red-600'>${loadFailedMsg}</p>`
|
||||
}
|
||||
}
|
||||
|
||||
function cleanInlineCode(content: string) {
|
||||
return content.replace(/<code>(.*?)<\/code>/g, (_, codeContent) => {
|
||||
return `<code class="bg-gray-200 text-gray-900 px-1 rounded">${codeContent.replace(/^`|`$/g, "")}</code>`
|
||||
})
|
||||
}
|
||||
|
||||
function wrapCodeBlocksWithCopyable(content: string) {
|
||||
return parse(content, {
|
||||
replace: (domNode: any) => {
|
||||
if (domNode.name === "pre" && domNode.children.length > 0) {
|
||||
const codeElement = domNode.children.find((child: any) => child.name === "code")
|
||||
if (codeElement) {
|
||||
const codeContent = codeElement.children[0]?.data?.trim() || ""
|
||||
return <CopyableCode code={codeContent} />
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export default async function CodeOfConductPage({ params }: { params: Promise<{ locale: string }> }) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.codeOfConduct" })
|
||||
const codeOfConductContent = await getCodeOfConductContent(t("errors.notFound"), t("errors.loadFailed"))
|
||||
const cleanedInlineCode = cleanInlineCode(codeOfConductContent)
|
||||
const parsedContent = wrapCodeBlocksWithCopyable(cleanedInlineCode)
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-white text-gray-900">
|
||||
<div className="container mx-auto px-4 py-16" style={{ maxWidth: "980px" }}>
|
||||
<div className="prose max-w-none text-[16px]">{parsedContent}</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
436
web/app/[locale]/docs/about/contributing/page.tsx
Normal file
436
web/app/[locale]/docs/about/contributing/page.tsx
Normal file
@@ -0,0 +1,436 @@
|
||||
import type { Metadata } from "next"
|
||||
import { getTranslations, getMessages, setRequestLocale } from "next-intl/server"
|
||||
import { Link } from "@/i18n/navigation"
|
||||
import { ExternalLink } from "lucide-react"
|
||||
import { DocHeader } from "@/components/ui/doc-header"
|
||||
import { Callout } from "@/components/ui/callout"
|
||||
import CopyableCode from "@/components/CopyableCode"
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>
|
||||
}): Promise<Metadata> {
|
||||
const { locale } = await params
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.contributing.meta" })
|
||||
return {
|
||||
title: t("title"),
|
||||
description: t("description"),
|
||||
keywords: [
|
||||
"proxmenux contributing",
|
||||
"proxmenux pull request",
|
||||
"proxmenux branch model",
|
||||
"proxmenux develop branch",
|
||||
"proxmenux script template",
|
||||
"proxmenux script header",
|
||||
"proxmox bash contribution",
|
||||
],
|
||||
alternates: { canonical: "https://proxmenux.com/docs/about/contributing" },
|
||||
openGraph: {
|
||||
title: t("ogTitle"),
|
||||
description: t("ogDescription"),
|
||||
type: "article",
|
||||
url: "https://proxmenux.com/docs/about/contributing",
|
||||
},
|
||||
twitter: {
|
||||
card: "summary",
|
||||
title: t("title"),
|
||||
description: "How to contribute scripts, dialogs and improvements to the ProxMenux project.",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type BranchingRow = { branch: string; purposeRich: string }
|
||||
type PhaseRow = { phaseRich: string; purposeRich: string; screenRich: string }
|
||||
type DialogRow = { toolRich: string; whenRich: string; effectRich: string }
|
||||
type MsgRow = { function: string; whenRich: string; spinner: string }
|
||||
type WhereNextItem =
|
||||
| { kind: "external"; url: string; label: string; tail: string }
|
||||
| { kind: "internal"; href: string; label: string; tail: string }
|
||||
|
||||
export default async function ContributingPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>
|
||||
}) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.contributing" })
|
||||
|
||||
const messages = (await getMessages({ locale })) as unknown as {
|
||||
docs: { about: { contributing: {
|
||||
branching: { rows: BranchingRow[] }
|
||||
scriptHeader: { bullets: string[] }
|
||||
twoPhase: { rows: PhaseRow[]; phase1Rules: string[] }
|
||||
dialogVsWhiptail: { rows: DialogRow[] }
|
||||
messageFunctions: { rows: MsgRow[] }
|
||||
dialogConventions: { bullets: string[] }
|
||||
translation: { bullets: string[] }
|
||||
variableStyle: { bullets: string[] }
|
||||
dosAndDonts: { doBullets: string[]; dontBullets: string[] }
|
||||
submitting: { steps: string[] }
|
||||
whereNext: { items: WhereNextItem[] }
|
||||
} } }
|
||||
}
|
||||
const block = messages.docs.about.contributing
|
||||
const branchingRows = block.branching.rows
|
||||
const scriptHeaderBullets = block.scriptHeader.bullets
|
||||
const twoPhaseRows = block.twoPhase.rows
|
||||
const phase1Rules = block.twoPhase.phase1Rules
|
||||
const dialogRows = block.dialogVsWhiptail.rows
|
||||
const msgRows = block.messageFunctions.rows
|
||||
const dialogBullets = block.dialogConventions.bullets
|
||||
const translationBullets = block.translation.bullets
|
||||
const variableStyleBullets = block.variableStyle.bullets
|
||||
const doBullets = block.dosAndDonts.doBullets
|
||||
const dontBullets = block.dosAndDonts.dontBullets
|
||||
const submittingSteps = block.submitting.steps
|
||||
const whereNextItems = block.whereNext.items
|
||||
|
||||
const code = (chunks: React.ReactNode) => <code>{chunks}</code>
|
||||
const strong = (chunks: React.ReactNode) => <strong>{chunks}</strong>
|
||||
const em = (chunks: React.ReactNode) => <em>{chunks}</em>
|
||||
const contributorsLink = (chunks: React.ReactNode) => (
|
||||
<Link href="/docs/about/contributors" className="text-blue-600 hover:underline">
|
||||
{chunks}
|
||||
</Link>
|
||||
)
|
||||
const cocLink = (chunks: React.ReactNode) => (
|
||||
<Link href="/docs/about/code-of-conduct" className="text-blue-600 hover:underline">
|
||||
{chunks}
|
||||
</Link>
|
||||
)
|
||||
const licenseLink = (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/blob/main/LICENSE"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
const securityLink = (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/blob/main/SECURITY.md"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
|
||||
return (
|
||||
<div>
|
||||
<DocHeader
|
||||
title={t("header.title")}
|
||||
description={t("header.description")}
|
||||
section={t("header.section")}
|
||||
estimatedMinutes={15}
|
||||
/>
|
||||
|
||||
<Callout variant="info" title={t("twoPagesCallout.title")}>
|
||||
{t.rich("twoPagesCallout.body", { contributorsLink, em })}
|
||||
</Callout>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("branching.heading")}</h2>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t("branching.intro")}</p>
|
||||
|
||||
<div className="overflow-x-auto mb-6">
|
||||
<table className="w-full text-sm border border-gray-200 rounded-md">
|
||||
<thead className="bg-gray-50 text-gray-900">
|
||||
<tr>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("branching.headerBranch")}</th>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("branching.headerPurpose")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="text-gray-800">
|
||||
{branchingRows.map((row, idx) => (
|
||||
<tr key={row.branch} className={idx < branchingRows.length - 1 ? "border-b border-gray-100" : ""}>
|
||||
<td className="px-3 py-2 align-top whitespace-nowrap"><strong><code>{row.branch}</code></strong></td>
|
||||
<td className="px-3 py-2 align-top">{t.rich(`branching.rows.${idx}.purposeRich`, { code })}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<Callout variant="tip" title={t("branching.calloutTitle")}>
|
||||
{t.rich("branching.calloutBody", { code })}
|
||||
</Callout>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("workflow.heading")}</h2>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t("workflow.intro")}</p>
|
||||
|
||||
<ol className="list-decimal pl-6 mb-4 text-gray-800 leading-relaxed space-y-2">
|
||||
<li>
|
||||
{t.rich("workflow.step1Lead", { code, strong })}
|
||||
<CopyableCode code={t.raw("workflow.step1Code") as string} className="my-3" />
|
||||
{t.rich("workflow.step1Trail", { code })}
|
||||
</li>
|
||||
<li>
|
||||
{t.rich("workflow.step2Lead", { strong })}
|
||||
<CopyableCode code={t.raw("workflow.step2Code") as string} className="my-3" />
|
||||
</li>
|
||||
<li>{t.rich("workflow.step3", { code, strong })}</li>
|
||||
<li>{t.rich("workflow.step4", { code, strong })}</li>
|
||||
<li>{t.rich("workflow.step5", { code, strong })}</li>
|
||||
</ol>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("scriptHeader.heading")}</h2>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("scriptHeader.intro", { strong })}</p>
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 text-gray-800 leading-relaxed space-y-2">
|
||||
{scriptHeaderBullets.map((_, idx) => (
|
||||
<li key={idx}>{t.rich(`scriptHeader.bullets.${idx}`, { strong, em })}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<Callout variant="info" title={t("scriptHeader.licenseCalloutTitle")}>
|
||||
{t.rich("scriptHeader.licenseCalloutBody", { strong, code, licenseLink })}
|
||||
</Callout>
|
||||
|
||||
<CopyableCode code={t.raw("scriptHeader.templateCode") as string} className="my-4" />
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("scriptHeader.optionalNote", { code })}</p>
|
||||
|
||||
<Callout variant="tip" title={t("scriptHeader.whyCalloutTitle")}>
|
||||
{t("scriptHeader.whyCalloutBody")}
|
||||
</Callout>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("structure.heading")}</h2>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t("structure.intro")}</p>
|
||||
|
||||
<CopyableCode code={t.raw("structure.treeCode") as string} className="my-4" />
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("structure.outro", { code })}</p>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("twoPhase.heading")}</h2>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("twoPhase.intro", { strong })}</p>
|
||||
|
||||
<div className="overflow-x-auto mb-6">
|
||||
<table className="w-full text-sm border border-gray-200 rounded-md">
|
||||
<thead className="bg-gray-50 text-gray-900">
|
||||
<tr>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("twoPhase.headerPhase")}</th>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("twoPhase.headerPurpose")}</th>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("twoPhase.headerScreen")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="text-gray-800">
|
||||
{twoPhaseRows.map((_, idx) => (
|
||||
<tr key={idx} className={idx < twoPhaseRows.length - 1 ? "border-b border-gray-100" : ""}>
|
||||
<td className="px-3 py-2 align-top whitespace-nowrap">{t.rich(`twoPhase.rows.${idx}.phaseRich`, { strong })}</td>
|
||||
<td className="px-3 py-2 align-top">{t.rich(`twoPhase.rows.${idx}.purposeRich`, { code })}</td>
|
||||
<td className="px-3 py-2 align-top">{t.rich(`twoPhase.rows.${idx}.screenRich`, { code })}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("twoPhase.principle", { strong })}</p>
|
||||
|
||||
<h3 className="text-lg font-semibold mt-6 mb-2 text-gray-900">{t("twoPhase.phase1Heading")}</h3>
|
||||
|
||||
<CopyableCode code={t.raw("twoPhase.phase1Code") as string} className="my-4" />
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("twoPhase.phase1RulesIntro", { strong })}</p>
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 text-gray-800 leading-relaxed space-y-1">
|
||||
{phase1Rules.map((_, idx) => (
|
||||
<li key={idx}>{t.rich(`twoPhase.phase1Rules.${idx}`, { code })}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<h3 className="text-lg font-semibold mt-6 mb-2 text-gray-900">{t("twoPhase.phase2Heading")}</h3>
|
||||
|
||||
<CopyableCode code={t.raw("twoPhase.phase2Code") as string} className="my-4" />
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("twoPhase.phase2Rules", { strong, code })}</p>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t.rich("dialogVsWhiptail.headingRich", { code })}</h2>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t("dialogVsWhiptail.intro")}</p>
|
||||
|
||||
<div className="overflow-x-auto mb-6">
|
||||
<table className="w-full text-sm border border-gray-200 rounded-md">
|
||||
<thead className="bg-gray-50 text-gray-900">
|
||||
<tr>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("dialogVsWhiptail.headerTool")}</th>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("dialogVsWhiptail.headerWhen")}</th>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("dialogVsWhiptail.headerEffect")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="text-gray-800">
|
||||
{dialogRows.map((_, idx) => (
|
||||
<tr key={idx} className={idx < dialogRows.length - 1 ? "border-b border-gray-100" : ""}>
|
||||
<td className="px-3 py-2 align-top whitespace-nowrap">{t.rich(`dialogVsWhiptail.rows.${idx}.toolRich`, { strong, code })}</td>
|
||||
<td className="px-3 py-2 align-top">{t.rich(`dialogVsWhiptail.rows.${idx}.whenRich`, { strong, code })}</td>
|
||||
<td className="px-3 py-2 align-top">{t.rich(`dialogVsWhiptail.rows.${idx}.effectRich`, { code, em })}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<Callout variant="info" title={t("dialogVsWhiptail.calloutTitle")}>
|
||||
{t.rich("dialogVsWhiptail.calloutBody", { code })}
|
||||
</Callout>
|
||||
|
||||
<h3 className="text-lg font-semibold mt-6 mb-2 text-gray-900">{t("dialogVsWhiptail.rebootHeading")}</h3>
|
||||
|
||||
<p className="mb-3 text-gray-800 leading-relaxed">{t.rich("dialogVsWhiptail.rebootIntro", { code })}</p>
|
||||
|
||||
<CopyableCode code={t.raw("dialogVsWhiptail.rebootCode") as string} className="my-4" />
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("messageFunctions.heading")}</h2>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("messageFunctions.intro", { code })}</p>
|
||||
|
||||
<div className="overflow-x-auto mb-6">
|
||||
<table className="w-full text-sm border border-gray-200 rounded-md">
|
||||
<thead className="bg-gray-50 text-gray-900">
|
||||
<tr>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("messageFunctions.headerFunction")}</th>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("messageFunctions.headerWhen")}</th>
|
||||
<th className="text-left px-3 py-2 border-b border-gray-200">{t("messageFunctions.headerSpinner")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="text-gray-800">
|
||||
{msgRows.map((row, idx) => (
|
||||
<tr key={idx} className={idx < msgRows.length - 1 ? "border-b border-gray-100" : ""}>
|
||||
<td className="px-3 py-2 align-top font-mono text-xs">{row.function}</td>
|
||||
<td className="px-3 py-2 align-top">{t.rich(`messageFunctions.rows.${idx}.whenRich`, { em })}</td>
|
||||
<td className="px-3 py-2 align-top">{row.spinner}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("dialogConventions.heading")}</h2>
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 text-gray-800 leading-relaxed space-y-1">
|
||||
{dialogBullets.map((_, idx) => (
|
||||
<li key={idx}>{t.rich(`dialogConventions.bullets.${idx}`, { code })}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<p className="mb-3 text-gray-800 leading-relaxed">{t("dialogConventions.exampleIntro")}</p>
|
||||
|
||||
<CopyableCode code={t.raw("dialogConventions.exampleCode") as string} className="my-4" />
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("translation.heading")}</h2>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("translation.intro", { code })}</p>
|
||||
|
||||
<CopyableCode code={t.raw("translation.code") as string} className="my-4" />
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 text-gray-800 leading-relaxed space-y-1">
|
||||
{translationBullets.map((_, idx) => (
|
||||
<li key={idx}>{t.rich(`translation.bullets.${idx}`, { strong })}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("variableStyle.heading")}</h2>
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 text-gray-800 leading-relaxed space-y-1">
|
||||
{variableStyleBullets.map((_, idx) => (
|
||||
<li key={idx}>{t.rich(`variableStyle.bullets.${idx}`, { code })}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t("variableStyle.standardNamesIntro")}</p>
|
||||
|
||||
<CopyableCode code={t.raw("variableStyle.standardNamesCode") as string} className="my-4" />
|
||||
|
||||
<h3 className="text-lg font-semibold mt-6 mb-2 text-gray-900">{t("variableStyle.redirectHeading")}</h3>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("variableStyle.redirectIntro", { code })}</p>
|
||||
|
||||
<p className="mb-3 text-gray-800 leading-relaxed">{t.rich("variableStyle.withoutRedirectIntro", { strong })}</p>
|
||||
|
||||
<CopyableCode code={t.raw("variableStyle.withoutRedirectCode") as string} className="my-4" />
|
||||
|
||||
<p className="mb-3 text-gray-800 leading-relaxed">{t.rich("variableStyle.withRedirectIntro", { strong })}</p>
|
||||
|
||||
<CopyableCode code={t.raw("variableStyle.withRedirectCode") as string} className="my-4" />
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t("variableStyle.twoPatternsIntro")}</p>
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 text-gray-800 leading-relaxed space-y-2">
|
||||
<li>
|
||||
{t.rich("variableStyle.discardLead", { strong })}
|
||||
<CopyableCode code={t.raw("variableStyle.discardCode") as string} className="my-3" />
|
||||
</li>
|
||||
<li>
|
||||
{t.rich("variableStyle.logLead", { strong })}
|
||||
<CopyableCode code={t.raw("variableStyle.logCode") as string} className="my-3" />
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("variableStyle.referenceOutro", { code })}</p>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("dosAndDonts.heading")}</h2>
|
||||
|
||||
<h3 className="text-lg font-semibold mt-6 mb-2 text-gray-900 text-green-700">{t("dosAndDonts.doHeading")}</h3>
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 text-gray-800 leading-relaxed space-y-1">
|
||||
{doBullets.map((_, idx) => (
|
||||
<li key={idx}>{t.rich(`dosAndDonts.doBullets.${idx}`, { code })}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<h3 className="text-lg font-semibold mt-6 mb-2 text-gray-900 text-red-700">{t("dosAndDonts.dontHeading")}</h3>
|
||||
|
||||
<ul className="list-disc pl-6 mb-4 text-gray-800 leading-relaxed space-y-1">
|
||||
{dontBullets.map((_, idx) => (
|
||||
<li key={idx}>{t.rich(`dosAndDonts.dontBullets.${idx}`, { code })}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("submitting.heading")}</h2>
|
||||
|
||||
<ol className="list-decimal pl-6 mb-4 text-gray-800 leading-relaxed space-y-2">
|
||||
{submittingSteps.map((_, idx) => (
|
||||
<li key={idx}>{t.rich(`submitting.steps.${idx}`, { code, em, strong, cocLink })}</li>
|
||||
))}
|
||||
</ol>
|
||||
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t.rich("submitting.securityOutro", { securityLink })}</p>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("whereNext.heading")}</h2>
|
||||
<ul className="list-disc pl-6 text-gray-800 leading-relaxed space-y-1">
|
||||
{whereNextItems.map((item, idx) => (
|
||||
<li key={idx}>
|
||||
{item.kind === "external" ? (
|
||||
<a
|
||||
href={item.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{item.label}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
) : (
|
||||
<Link href={item.href} className="text-blue-600 hover:underline">
|
||||
{item.label}
|
||||
</Link>
|
||||
)}
|
||||
{item.tail}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
181
web/app/[locale]/docs/about/contributors/page.tsx
Normal file
181
web/app/[locale]/docs/about/contributors/page.tsx
Normal file
@@ -0,0 +1,181 @@
|
||||
import type { Metadata } from "next"
|
||||
import Image from "next/image"
|
||||
import { getTranslations, setRequestLocale } from "next-intl/server"
|
||||
import { Youtube, FlaskRound, ExternalLink } from "lucide-react"
|
||||
import { DocHeader } from "@/components/ui/doc-header"
|
||||
import { Callout } from "@/components/ui/callout"
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {
|
||||
const { locale } = await params
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.contributors.meta" })
|
||||
return {
|
||||
title: t("title"),
|
||||
description: t("description"),
|
||||
openGraph: {
|
||||
title: t("ogTitle"),
|
||||
description: t("ogDescription"),
|
||||
type: "article",
|
||||
url: "https://macrimi.github.io/ProxMenux/docs/about/contributors",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
interface Contributor {
|
||||
name: string
|
||||
roleKey: "testing" | "testingReviewer"
|
||||
avatar: string
|
||||
youtubeUrl?: string
|
||||
}
|
||||
|
||||
const contributors: Contributor[] = [
|
||||
{
|
||||
name: "MALOW",
|
||||
roleKey: "testing",
|
||||
avatar: "https://raw.githubusercontent.com/MacRimi/ProxMenux/main/images/avatars/malow.png",
|
||||
},
|
||||
{
|
||||
name: "Segarra",
|
||||
roleKey: "testing",
|
||||
avatar: "https://raw.githubusercontent.com/MacRimi/ProxMenux/main/images/avatars/segarra.png",
|
||||
},
|
||||
{
|
||||
name: "Aprilia",
|
||||
roleKey: "testing",
|
||||
avatar: "https://raw.githubusercontent.com/MacRimi/ProxMenux/main/images/avatars/aprilia.png",
|
||||
},
|
||||
{
|
||||
name: "Jonatan Castro",
|
||||
roleKey: "testingReviewer",
|
||||
avatar: "https://raw.githubusercontent.com/MacRimi/ProxMenux/main/images/avatars/jonatancastro.png",
|
||||
youtubeUrl: "https://www.youtube.com/@JonatanCastro",
|
||||
},
|
||||
{
|
||||
name: "Kamunhas",
|
||||
roleKey: "testing",
|
||||
avatar: "https://raw.githubusercontent.com/MacRimi/ProxMenux/main/images/avatars/Kamunhas.png",
|
||||
},
|
||||
]
|
||||
|
||||
export default async function ContributorsPage({ params }: { params: Promise<{ locale: string }> }) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.contributors" })
|
||||
|
||||
const strong = (chunks: React.ReactNode) => <strong>{chunks}</strong>
|
||||
const extlink = (href: string) => (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href={href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-700 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
const extlinkBlue = (href: string) => (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href={href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
const extlinkEmerald = (href: string) => (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href={href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-emerald-700 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
|
||||
return (
|
||||
<div>
|
||||
<DocHeader
|
||||
title={t("header.title")}
|
||||
description={t("header.description")}
|
||||
section={t("header.section")}
|
||||
estimatedMinutes={1}
|
||||
/>
|
||||
|
||||
<Callout variant="info" title={t("beyond.title")}>
|
||||
{t.rich("beyond.body", {
|
||||
extlink: extlink("https://github.com/MacRimi/ProxMenux/graphs/contributors"),
|
||||
})}
|
||||
</Callout>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("testers.heading")}</h2>
|
||||
|
||||
<p className="mb-6 text-gray-800 leading-relaxed">{t("testers.intro")}</p>
|
||||
|
||||
<div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-6 mt-6 mb-8 not-prose">
|
||||
{contributors.map((c) => (
|
||||
<div key={c.name} className="text-center">
|
||||
<div className="relative inline-block">
|
||||
<Image
|
||||
src={c.avatar}
|
||||
alt={c.name}
|
||||
width={80}
|
||||
height={80}
|
||||
className="w-20 h-20 rounded-full border-2 border-gray-300 object-cover"
|
||||
unoptimized
|
||||
/>
|
||||
<div className="absolute -bottom-1 -right-1 bg-orange-500 rounded-full p-1">
|
||||
<FlaskRound className="h-4 w-4 text-white" aria-hidden />
|
||||
</div>
|
||||
</div>
|
||||
<h3 className="text-base font-semibold text-gray-900 mt-2 mb-0">{c.name}</h3>
|
||||
<p className="text-xs text-gray-600 mt-0.5">{t(`testers.roles.${c.roleKey}`)}</p>
|
||||
{c.youtubeUrl && (
|
||||
<a
|
||||
href={c.youtubeUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 mt-1 text-xs text-red-600 hover:text-red-700"
|
||||
>
|
||||
<Youtube className="h-3.5 w-3.5" aria-hidden /> {t("testers.youtube")}
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("contribute.heading")}</h2>
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">{t("contribute.intro")}</p>
|
||||
<ul className="list-disc pl-6 mb-6 text-gray-800 leading-relaxed space-y-1">
|
||||
<li>
|
||||
{t.rich("contribute.tester", {
|
||||
strong,
|
||||
beta: extlinkBlue("https://github.com/MacRimi/ProxMenux/blob/develop/install_proxmenux_beta.sh"),
|
||||
})}
|
||||
</li>
|
||||
<li>
|
||||
{t.rich("contribute.developer", {
|
||||
strong,
|
||||
gh: extlinkBlue("https://github.com/MacRimi/ProxMenux/pulls"),
|
||||
})}
|
||||
</li>
|
||||
<li>{t.rich("contribute.designer", { strong })}</li>
|
||||
<li>
|
||||
{t.rich("contribute.ideas", {
|
||||
strong,
|
||||
disc: extlinkBlue("https://github.com/MacRimi/ProxMenux/discussions"),
|
||||
})}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<Callout variant="tip" title={t("coc.title")}>
|
||||
{t.rich("coc.body", {
|
||||
coclink: extlinkEmerald("https://github.com/MacRimi/ProxMenux/blob/main/CODE_OF_CONDUCT.md"),
|
||||
})}
|
||||
</Callout>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
255
web/app/[locale]/docs/about/faq/page.tsx
Normal file
255
web/app/[locale]/docs/about/faq/page.tsx
Normal file
@@ -0,0 +1,255 @@
|
||||
import type { Metadata } from "next"
|
||||
import { getTranslations, getMessages, setRequestLocale } from "next-intl/server"
|
||||
import { Link } from "@/i18n/navigation"
|
||||
import { ExternalLink } from "lucide-react"
|
||||
import { DocHeader } from "@/components/ui/doc-header"
|
||||
import { Callout } from "@/components/ui/callout"
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>
|
||||
}): Promise<Metadata> {
|
||||
const { locale } = await params
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.faq.meta" })
|
||||
return {
|
||||
title: t("title"),
|
||||
description: t("description"),
|
||||
openGraph: {
|
||||
title: t("ogTitle"),
|
||||
description: t("ogDescription"),
|
||||
type: "article",
|
||||
url: "https://macrimi.github.io/ProxMenux/docs/about/faq",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
interface QAProps {
|
||||
q: string
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
function QA({ q, children }: QAProps) {
|
||||
return (
|
||||
<div className="mb-8">
|
||||
<h2 className="text-xl font-semibold mb-3 text-gray-900">{q}</h2>
|
||||
<div className="text-gray-800 leading-relaxed space-y-3">{children}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default async function FaqPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>
|
||||
}) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.faq" })
|
||||
|
||||
const messages = (await getMessages({ locale })) as unknown as {
|
||||
docs: {
|
||||
about: {
|
||||
faq: {
|
||||
q1: { items: string[] }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const q1Items = messages.docs.about.faq.q1.items
|
||||
|
||||
const code = (chunks: React.ReactNode) => <code>{chunks}</code>
|
||||
const strong = (chunks: React.ReactNode) => <strong>{chunks}</strong>
|
||||
const em = (chunks: React.ReactNode) => <em>{chunks}</em>
|
||||
|
||||
const installlink = (chunks: React.ReactNode) => (
|
||||
<Link href="/docs/installation" className="text-blue-600 hover:underline">
|
||||
{chunks}
|
||||
</Link>
|
||||
)
|
||||
const upgradelink = (chunks: React.ReactNode) => (
|
||||
<Link href="/docs/utils/upgrade-pve8-pve9" className="text-blue-600 hover:underline">
|
||||
{chunks}
|
||||
</Link>
|
||||
)
|
||||
const betalink = (chunks: React.ReactNode) => (
|
||||
<Link href="/docs/settings/beta-program" className="text-blue-600 hover:underline">
|
||||
{chunks}
|
||||
</Link>
|
||||
)
|
||||
const uninstalllink = (chunks: React.ReactNode) => (
|
||||
<Link href="/docs/settings/uninstall-proxmenux" className="text-blue-600 hover:underline">
|
||||
{chunks}
|
||||
</Link>
|
||||
)
|
||||
const contriblink = (chunks: React.ReactNode) => (
|
||||
<Link href="/docs/about/contributors" className="text-blue-600 hover:underline">
|
||||
{chunks}
|
||||
</Link>
|
||||
)
|
||||
const issueslink = (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/issues"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
const coclink = (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/blob/main/CODE_OF_CONDUCT.md"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
const discusslink = (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/discussions"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
const scriptlink = (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/blob/main/install_proxmenux.sh"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
const issuelink = (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/issues/162"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
|
||||
return (
|
||||
<div>
|
||||
<DocHeader
|
||||
title={t("header.title")}
|
||||
description={t("header.description")}
|
||||
section={t("header.section")}
|
||||
estimatedMinutes={5}
|
||||
/>
|
||||
|
||||
<Callout variant="info" title={t("quickLinks.title")}>
|
||||
<ul className="list-disc pl-6 mb-0 space-y-1">
|
||||
<li>
|
||||
<Link href="/docs/installation" className="text-blue-700 hover:underline">
|
||||
{t("quickLinks.installationLabel")}
|
||||
</Link>
|
||||
{t("quickLinks.installationSuffix")}
|
||||
</li>
|
||||
<li>
|
||||
<Link href="/docs/introduction" className="text-blue-700 hover:underline">
|
||||
{t("quickLinks.introductionLabel")}
|
||||
</Link>
|
||||
{t("quickLinks.introductionSuffix")}
|
||||
</li>
|
||||
<li>
|
||||
<Link href="/docs/settings/uninstall-proxmenux" className="text-blue-700 hover:underline">
|
||||
{t("quickLinks.uninstallLabel")}
|
||||
</Link>
|
||||
{t("quickLinks.uninstallSuffix")}
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/issues"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-700 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{t("quickLinks.issuesLabel")}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>{" "}
|
||||
·{" "}
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux/discussions"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-700 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{t("quickLinks.discussionsLabel")}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</Callout>
|
||||
|
||||
<QA q={t("q1.question")}>
|
||||
<p>{t.rich("q1.p1Rich", { strong })}</p>
|
||||
<p>{t("q1.p2")}</p>
|
||||
<p className="mb-0">{t("q1.p3")}</p>
|
||||
<ul className="list-disc pl-6 mb-0 space-y-1">
|
||||
{q1Items.map((_, idx) => (
|
||||
<li key={idx}>{t(`q1.items.${idx}`)}</li>
|
||||
))}
|
||||
</ul>
|
||||
</QA>
|
||||
|
||||
<QA q={t("q2.question")}>
|
||||
<p>{t.rich("q2.p1Rich", { installlink })}</p>
|
||||
<pre className="rounded-md bg-gray-100 p-4 overflow-x-auto text-xs font-mono text-gray-800 border border-gray-200">
|
||||
{t("q2.stableInstall")}
|
||||
</pre>
|
||||
<p>{t("q2.p2")}</p>
|
||||
<pre className="rounded-md bg-gray-100 p-4 overflow-x-auto text-xs font-mono text-gray-800 border border-gray-200">
|
||||
{t("q2.menuCmd")}
|
||||
</pre>
|
||||
</QA>
|
||||
|
||||
<QA q={t("q3.question")}>
|
||||
<p>{t.rich("q3.bodyRich", { strong, upgradelink })}</p>
|
||||
</QA>
|
||||
|
||||
<QA q={t("q5.question")}>
|
||||
<p>{t.rich("q5.p1Rich", { code })}</p>
|
||||
<p className="mb-0">{t.rich("q5.p2Rich", { betalink })}</p>
|
||||
</QA>
|
||||
|
||||
<QA q={t("q6.question")}>
|
||||
<p>{t.rich("q6.p1Rich", { issueslink, code })}</p>
|
||||
<p className="mb-0">{t.rich("q6.p2Rich", { strong, coclink })}</p>
|
||||
</QA>
|
||||
|
||||
<QA q={t("q7.question")}>
|
||||
<p>{t.rich("q7.p1Rich", { strong })}</p>
|
||||
<ul className="list-disc pl-6 mb-0 space-y-1">
|
||||
<li>{t.rich("q7.item1Rich", { discusslink })}</li>
|
||||
<li>{t.rich("q7.item2Rich", { coclink })}</li>
|
||||
<li>{t.rich("q7.item3Rich", { contriblink })}</li>
|
||||
</ul>
|
||||
</QA>
|
||||
|
||||
<QA q={t("q10.question")}>
|
||||
<p>{t.rich("q10.p1Rich", { strong, code })}</p>
|
||||
<p className="mb-0">{t.rich("q10.p2Rich", { uninstalllink })}</p>
|
||||
</QA>
|
||||
|
||||
<QA q={t("q11.question")}>
|
||||
<p>{t.rich("q11.p1Rich", { em, code })}</p>
|
||||
<p className="mb-0">{t.rich("q11.p2Rich", { scriptlink, issuelink })}</p>
|
||||
</QA>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
161
web/app/[locale]/docs/about/page.tsx
Normal file
161
web/app/[locale]/docs/about/page.tsx
Normal file
@@ -0,0 +1,161 @@
|
||||
import type { Metadata } from "next"
|
||||
import { getTranslations, getMessages, setRequestLocale } from "next-intl/server"
|
||||
import { Link } from "@/i18n/navigation"
|
||||
import { ArrowRight, Users, HelpCircle, ScrollText, Heart, Star, ExternalLink } from "lucide-react"
|
||||
import { DocHeader } from "@/components/ui/doc-header"
|
||||
import { Callout } from "@/components/ui/callout"
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>
|
||||
}): Promise<Metadata> {
|
||||
const { locale } = await params
|
||||
const t = await getTranslations({ locale, namespace: "docs.about.meta" })
|
||||
return {
|
||||
title: t("title"),
|
||||
description: t("description"),
|
||||
openGraph: {
|
||||
title: t("ogTitle"),
|
||||
description: t("ogDescription"),
|
||||
type: "article",
|
||||
url: "https://macrimi.github.io/ProxMenux/docs/about",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type SectionOption = {
|
||||
icon: string
|
||||
href: string
|
||||
title: string
|
||||
description: string
|
||||
}
|
||||
|
||||
type InvolvedCard = {
|
||||
href: string
|
||||
title: string
|
||||
description: string
|
||||
}
|
||||
|
||||
const ICONS: Record<string, React.ComponentType<{ className?: string; "aria-hidden"?: boolean }>> = {
|
||||
HelpCircle,
|
||||
Users,
|
||||
ScrollText,
|
||||
}
|
||||
|
||||
function OptionCard({ option }: { option: SectionOption }) {
|
||||
const Icon = ICONS[option.icon] || HelpCircle
|
||||
return (
|
||||
<Link
|
||||
href={option.href}
|
||||
className="group flex items-start gap-3 rounded-md border border-gray-200 bg-white p-3 transition-colors hover:border-blue-400 hover:bg-blue-50"
|
||||
>
|
||||
<span className="inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md bg-gray-100 text-gray-600 group-hover:bg-blue-100 group-hover:text-blue-700">
|
||||
<Icon className="h-4 w-4" aria-hidden />
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center gap-1 text-sm font-medium text-gray-900 group-hover:text-blue-700">
|
||||
{option.title}
|
||||
<ArrowRight className="h-3.5 w-3.5 text-gray-400 group-hover:text-blue-600 transition-transform group-hover:translate-x-0.5" />
|
||||
</div>
|
||||
<div className="mt-0.5 text-xs text-gray-600 leading-snug">{option.description}</div>
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
export default async function AboutOverviewPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>
|
||||
}) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations({ locale, namespace: "docs.about" })
|
||||
|
||||
const messages = (await getMessages({ locale })) as unknown as {
|
||||
docs: {
|
||||
about: {
|
||||
section: { options: SectionOption[] }
|
||||
involved: { cards: InvolvedCard[] }
|
||||
}
|
||||
}
|
||||
}
|
||||
const options = messages.docs.about.section.options
|
||||
const involvedCards = messages.docs.about.involved.cards
|
||||
|
||||
const starlink = (chunks: React.ReactNode) => (
|
||||
<a
|
||||
href="https://github.com/MacRimi/ProxMenux"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-600 hover:underline inline-flex items-center gap-1"
|
||||
>
|
||||
{chunks}
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)
|
||||
|
||||
return (
|
||||
<div>
|
||||
<DocHeader
|
||||
title={t("header.title")}
|
||||
description={t("header.description")}
|
||||
section={t("header.section")}
|
||||
estimatedMinutes={2}
|
||||
/>
|
||||
|
||||
<Callout variant="info" title={t("callout.title")}>
|
||||
{t("callout.body")}
|
||||
</Callout>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("section.heading")}</h2>
|
||||
<div className="grid gap-3 md:grid-cols-2 mb-8 not-prose">
|
||||
{options.map((o) => (
|
||||
<OptionCard key={o.href} option={o} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">{t("involved.heading")}</h2>
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">
|
||||
{t("involved.intro")}
|
||||
</p>
|
||||
<div className="grid gap-3 md:grid-cols-3 mb-6 not-prose">
|
||||
{involvedCards.map((card) => (
|
||||
<a
|
||||
key={card.href}
|
||||
href={card.href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-start justify-between gap-3 rounded-md border border-gray-200 bg-white p-4 transition-colors hover:border-blue-400 hover:bg-blue-50"
|
||||
>
|
||||
<div>
|
||||
<div className="font-semibold text-gray-900 mb-1">{card.title}</div>
|
||||
<div className="text-xs text-gray-600">{card.description}</div>
|
||||
</div>
|
||||
<ExternalLink className="w-3.5 h-3.5 text-gray-400 mt-0.5 flex-shrink-0" aria-hidden />
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<h2 className="text-2xl font-semibold mt-10 mb-4 text-gray-900">
|
||||
<Star className="inline h-5 w-5 mr-1 -mt-1 text-amber-500" aria-hidden />
|
||||
{t("support.heading")}
|
||||
</h2>
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">
|
||||
{t.rich("support.introRich", { starlink })}
|
||||
</p>
|
||||
<p className="mb-4 text-gray-800 leading-relaxed">
|
||||
<a
|
||||
href="https://ko-fi.com/G2G313ECAN"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 text-pink-600 hover:underline"
|
||||
>
|
||||
<Heart className="h-4 w-4" aria-hidden /> {t("support.kofiLabel")}
|
||||
</a>
|
||||
{t("support.kofiOutro")}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user