pnpm install- Install dependenciespnpm run start- Start development server (localhost:3000)pnpm run start -h 0.0.0.0- Start with external access for GitHub Codespacespnpm run serve- Serve built site locallypnpm run clear- Clear Docusaurus cache
pnpm run build- Build production versionpnpm run typecheck- Run TypeScript type checking
pnpm run write-translations- Generate translation filespnpm run write-heading-ids- Generate heading IDs for MDX
docs/
├── docs/
│ ├── manual/
│ │ ├── class/ # Luogu class and paid services docs
│ │ ├── luogu/ # Main site operation guide
│ │ │ ├── account/ # Account management
│ │ │ ├── problem/ # Problem-related guides
│ │ │ └── team/ # Team and group features
│ │ └── _image/ # Images for manual docs
│ ├── rules/
│ │ ├── community/ # Community rules
│ │ └── academic/ # Academic guidelines
│ │ ├── guide/ # Academic guides
│ │ ├── handbook/ # Academic handbook
│ │ └── lgr/ # Luogu official contests guidelines
│ │ └── _image/ # Images for rules docs
│ └── ula/ # User License Agreements
├── src/
│ ├── pages/ # Custom pages (about, contact, etc.)
│ └── style.css # Custom theme styles
└── static/img/ # Static images
Docusaurus Configuration
├── docusaurus.config.ts # Main configuration
├── sidebars.ts # Sidebar structure
├── tsconfig.json # TypeScript config
└── babel.config.js # Babel configuration
Frontmatter Format:
---
sidebar_position: 1
---- Use Chinese language for all content (zh-Hans)
- Use
sidebar_positionto control documentation order in sidebar - Maintain consistent heading levels (use H1 for page titles, H2-H4 for sections)
- Use bullet points and numbered lists for clarity
- Include images in
docs/*/ordocs/*/_image/directories with descriptive filenames
Content Structure:
- Start with a brief introduction if applicable
- Use subheadings for main sections
- Provide clear step-by-step instructions for guides
- Include warnings, notes, and important information using standard markdown
- Extends Docusaurus default TypeScript configuration
- Compiler options in
tsconfig.json - Use type checking before commits (
pnpm run typecheck)
- Use Docusaurus preset as default
- No additional plugins configured
Documentation:
- Use descriptive filenames in lowercase with hyphens:
image-hosting.md - Use snake_case for image directories:
_image/ - Page titles use H1 heading
Image Files:
- Use descriptive names with underscores:
TrainingList1.jpg - Include sequence numbers for multi-step guides
Code Blocks:
- Specify language for syntax highlighting:
markdown,typescript, ````bash, etc.
- Use clear, concise, and professional Chinese language
- Be instructional and user-friendly
- Avoid unnecessary technical jargon or explain it when used
- Maintain consistency in terminology across documents
- Introduction: Brief overview of what the page covers
- Key Sections: Organized with clear headings
- Examples: Include screenshots where appropriate (in
_imagedirectories) - Related Links: Reference other relevant documentation
- Contact Info: Provide contact/support information when needed
- Keep content up-to-date with the actual website functionality
- Use the
release-note.mdpage for major changes - Include relative image paths:
 - Update
sidebars.tswhen adding new documentation sections - Test that links work correctly
- Use Docusaurus features like admonitions when appropriate
Before committing changes:
- Run
pnpm run typecheckto verify TypeScript types - Run
pnpm run buildto ensure production build succeeds - Check for broken links in markdown files
- Verify image paths are correct
- Test documentation navigation in development mode
- Ensure all internal links use relative paths starting with
/
- Write commit messages in Chinese
- Be descriptive about what was changed
- Include relevant context in the message
- Examples:
- "更新洛谷题单功能说明"
- "添加学术规范新章节"
- "修复图片路径错误"
- Project uses Docusaurus 3.6.1
- Package manager: pnpm (recommended)
- Node.js version: >=20.17
- Math/TeX support via remarkMath and rehypeKatex
- Search functionality via @easyops-cn/docusaurus-search-local
- No linting or formatting configuration (uses editor defaults)