Files
2026-10-21 10:36:44 +08:00

3.9 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this is

A VitePress 1.3.4 documentation site (Chinese, zh-CN) for the EasyGoAdmin project (GoFrame v2 + Vue3 + ElementPlus). All content is Markdown under zh/; there is no application source code here. No lint/test tooling exists — only dev/build/preview.

Commands

pnpm install        # or: yarn install (yarn.lock is the committed lockfile, despite README saying pnpm)
pnpm docs           # dev server: vitepress dev .
pnpm docs:build     # static build to .vitepress/dist
pnpm docs:preview   # preview built site

Dependencies may not be installed (node_modules absent). There is no single-page test/run command; to check a page, run the dev server or docs:build (build also catches dead links — only localhost links are exempt via ignoreDeadLinks in .vitepress/config/index.ts).

Repository context

The git repo root is E:/EasyGoAdmin_V3/document, which contains 16 sibling documentation projects (EasyGoAdmin_{Beego,Gin,GoFrame,Iris}_{AntdVue,EleVue,Layui,NaiveVue}). This project is EasyGoAdmin_GoFrame_EleVue. Git status/commits therefore span all 16 — scope your changes and commits to this directory unless told otherwise. Branch: master.

Architecture (the parts that require multiple files to understand)

  • .vitepress/config/index.ts — merges sharedConfig + locale config. The root locale is Chinese (link: "/"); the English locale in en.ts is fully commented out.
  • .vitepress/config/zh.ts — the single source of truth for nav and sidebar. The sidebar manually lists every page with a numbered title (e.g. { text: "📄 3.3 DAO 数据层", link: "/zh/guide/model.html" }). Adding, renaming, or renumbering a page requires a matching edit here; the site gives no warning if you forget (dead-link checks do not cover the sidebar).
  • .vitepress/config/shared.ts — site-wide head/meta, custom slugify (anchors), markdown code themes, local search, Gitee edit links. zhSearch (Algolia) is exported but unused.
  • .vitepress/theme/index.ts — extends the default theme, overrides the home hero image, wires vitepress-plugin-image-viewer. Theme components in .vitepress/theme/components/ (sponsors, video link) are currently not registered/used by any page.
  • .vitepress/theme/styles/vars.css — CSS variables; appearance: "light" is the default.

Content conventions (enforce these when creating/editing pages)

  1. Every page starts with # N.N 标题 (or # A. 标题 for appendices) matching its sidebar numbering exactly, followed by a :::tip 概述 block summarizing the page (142/143 pages follow this).
  2. No frontmatter on content pages — only index.md uses it (layout: home).
  3. Sidebar links use the .html suffix (/zh/guide/model.html); in-body links are relative and extensionless ([5.10 字典模块](../core/dict)). Zero absolute or .html links appear in page bodies — keep it that way.
  4. Internal cross-references between chapters use relative ../ paths from the page's own directory.
  5. Body content contains no image references; images live only in index.md and public/.
  6. Structure pages with ##/### headings only (outline is [2, 3]). Custom containers: :::tip 概述 is the standard page opener; :::warning used sparingly.
  7. Content language is Chinese throughout (tables, headings, prose), with English technical terms (routes, table names, code identifiers) kept as-is.

Gotchas

  • Two pages (zh/course.md, zh/quickstart/environment.md) contain ```mermaid fences, but no mermaid plugin is installed — they render as plain code blocks. vitepress-plugin-group-icons is in package.json but never wired into config.
  • .vitepress/translation-status.json is not read by any code.
  • Numbered sidebar titles are duplicated in prose cross-references (e.g. "详见 5.10"); keep both in sync when renumbering.