Skip to content
copper-lampPublic

About

copper lamp org docs web

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CopperLamp Docs

Static Next.js + Fumadocs MDX site for the CopperLamp organization. The public site is at https://copper-lamp.github.io/docs/. English is the default; Simplified Chinese uses the /zh-CN/ prefix.

Development

Use Node.js 24 and pnpm 11 (the version pinned in packageManager).

pnpm install
pnpm run dev
pnpm run types:check
pnpm run build
pnpm run test:export

GitHub Actions supplies NEXT_PUBLIC_BASE_PATH from Pages, normally /docs. To reproduce that build locally, set the variable for both build and test:export. Publish out/ as a static artifact, retaining _next/, 404.html, and search-index.json.

pnpm-workspace.yaml allows esbuild's install script and disables pnpm's release-age gate so CI installs the versions pinned in pnpm-lock.yaml; upgrade dependencies deliberately and commit the lockfile.

Interface

The interface is the stock Fumadocs UI: guides render in the official Glass layout (fumadocs-ui/layouts/glass) and the theme is the official VitePress theme. app/global.css imports fumadocs-ui/css/generated/glass.css, fumadocs-ui/css/vitepress.css and fumadocs-ui/css/preset.css, then overrides only the dark brand color: VitePress ships #a8b1ff, which reads as purple, so .dark sets --color-fd-primary and --color-fd-ring to #6ea8fe. Light mode keeps the official #3451b2. Do not add any other palette, component styles, or borders. The homepage project index is plain Tailwind utilities over the theme's fd-* tokens.

Navigation and motion

The home navbar (siteNavigation) carries the brand, one entry per registered project, and the language link at the right edge. Reading pages instead lead with structure inside the sidebar: projectTabs(locale) feeds the Glass layout project switcher at the top, SidebarSearch renders a full search trigger below it, and the current project tree follows. docsNavigation sets searchTrigger: false, so the header never shows a second search box.

The reading header keeps the brand, the theme switch, and the language switch. LocaleSwitchProvider gives LocaleSwitchLink and LocaleSwitchText the alternate URL, replacing the stock popover, which needs i18n.locales and would be empty with a single alternate locale. Pages without a translation link to the other language project page and carry a hint instead of a broken URL. Fumadocs hands a custom slot only the shell classes and the button variant, so LocaleSwitchLink builds the inline-flex layout and, for variant: secondary, the secondary button surface itself. The stock trigger does that inside LanguageSelect; skipping it stacks the icon, name and chevron vertically.

Motion is limited to opacity and transform: app/global.css fades #nd-page in, gives sidebar and table-of-contents links a colour transition, and disables both under prefers-reduced-motion. Project cards use Tailwind utilities only.

Search metadata

lib/seo.ts holds every search-facing string: keyword sets per locale, project, and guide group, plus JSON-LD builders (Organization, WebSite, SoftwareApplication, BreadcrumbList, TechArticle). pageMetadata attaches keywords, Open Graph, Twitter, robots directives, the canonical URL and hreflang alternates. app/sitemap.ts and app/robots.ts emit sitemap.xml and robots.txt at build time. Keywords only extend metadata; page titles, slugs and URLs stay as written, so no URL changes when a term is added.

Brand assets

The organization avatar is a repository asset at public/brand/organization-avatar.png, exposed through brandAvatar in lib/site.ts; it is prefixed with NEXT_PUBLIC_BASE_PATH, so the header mark and the favicon resolve under /docs. The launcher product icon is hotlinked from the link the maintainer provided, in projectIcons; projects without an icon fall back to a Lucide glyph.

Every brand file must be a transparent PNG so it reads on the light and dark themes alike. The image host flattens the avatar onto a black matte, so the checked-in copy has that matte keyed out to real alpha (300×300; the source had exactly (0,0,0) matte and a hard edge, so nothing else changed). When a new avatar export arrives, regenerate the file from the source instead of pointing brandAvatar back at the image host. The launcher icon is a 1024×1024 export shown at 20px; replace the link with a smaller export when one is available.

Content source

Only content/docs/<locale>/<project>/ is compiled. Supported locales are en-US and zh-CN; registered projects are launcher and bepack. Place reviewed .mdx or .md files there with a title in frontmatter. Use lowercase kebab-case filenames and directories.

The first directory below the project is a sidebar group: content/docs/en-US/launcher/getting-started/install.mdx renders at /guides/launcher/getting-started/install/ under the Getting started group. Every group needs a meta.json with its display title and the page names in reading order under pages; the project folder's meta.json carries the project title. Groups and their order therefore live in content, not in code. The reading sidebar lists one project at a time; the project switcher at the top of the sidebar changes projects.

Keep the same project and relative slug across translations; pages without a matching translation link to the other language's project page. The project landing page is generated, so a top-level project index.mdx is reserved; it lists the project's groups.

The checked-in launcher pages are structure only: each holds a This page is being written callout. Replace that callout with the guide body and keep the frontmatter title and description.

These directories are for public user guides maintained by the project teams. Do not copy internal engineering notes into them. Project registration, navigation labels, and project links are maintained in lib/site.ts.

About

copper lamp org docs web

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages