|
1 | | -# AI Development Agent Instructions |
| 1 | +# AGENTS.md |
2 | 2 |
|
3 | 3 | This file provides guidance to AI coding assistants (Claude Code, Cursor, GitHub Copilot, etc.) when working with code in this repository. |
4 | 4 |
|
5 | 5 | ## Project Overview |
6 | 6 |
|
7 | | -This is the **Apache HugeGraph documentation website** repository (`hugegraph-doc`), built with Hugo static site generator using the Docsy theme. The site provides comprehensive documentation for the HugeGraph graph database system, including quickstart guides, API references, configuration guides, and contribution guidelines. |
| 7 | +Apache HugeGraph documentation website built with Hugo static site generator and the Docsy theme. The site is bilingual (Chinese/English) and covers the complete HugeGraph graph database ecosystem. |
8 | 8 |
|
9 | | -The documentation is multilingual, supporting both **Chinese (cn)** and **English (en)** content. |
10 | | - |
11 | | -## Development Setup |
12 | | - |
13 | | -### Prerequisites |
14 | | - |
15 | | -1. **Hugo Extended** (v0.95.0 recommended, v0.102.3 used in CI) |
16 | | - - Must be the "extended" version (includes SASS/SCSS support) |
17 | | - - Download from: https://github.com/gohugoio/hugo/releases |
18 | | - - Install location: `/usr/bin` or `/usr/local/bin` |
19 | | - |
20 | | -2. **Node.js and npm** (v16+ as specified in CI) |
21 | | - |
22 | | -### Quick Start |
| 9 | +## Development Commands |
23 | 10 |
|
24 | 11 | ```bash |
25 | | -# Install npm dependencies (autoprefixer, postcss, postcss-cli) |
| 12 | +# Install dependencies |
26 | 13 | npm install |
27 | 14 |
|
28 | | -# Start local development server (with auto-reload) |
| 15 | +# Start development server (auto-reload enabled) |
29 | 16 | hugo server |
30 | 17 |
|
31 | | -# Custom server with different ip/port |
32 | | -hugo server -b http://127.0.0.1 -p 80 --bind=0.0.0.0 |
33 | | - |
34 | 18 | # Build production site (output to ./public) |
35 | 19 | hugo --minify |
36 | | -``` |
37 | | - |
38 | | -## Project Structure |
39 | | - |
40 | | -### Key Directories |
41 | | - |
42 | | -- **`content/`** - All documentation content in Markdown |
43 | | - - `content/cn/` - Chinese (simplified) documentation |
44 | | - - `content/en/` - English documentation |
45 | | - - Each language has parallel structure: `docs/`, `blog/`, `community/`, `about/` |
46 | | - |
47 | | -- **`themes/docsy/`** - The Docsy Hugo theme (submodule or vendored) |
48 | | - |
49 | | -- **`static/`** - Static assets (images, files) served directly |
50 | | - |
51 | | -- **`assets/`** - Assets processed by Hugo pipelines (SCSS, images for processing) |
52 | | - |
53 | | -- **`layouts/`** - Custom Hugo template overrides for the Docsy theme |
54 | | - |
55 | | -- **`public/`** - Generated site output (gitignored, created by `hugo` build) |
56 | | - |
57 | | -- **`dist/`** - Additional distribution files |
58 | | - |
59 | | -### Important Files |
60 | | - |
61 | | -- **`config.toml`** - Main site configuration |
62 | | - - Defines language settings (cn as default, en available) |
63 | | - - Menu structure and navigation |
64 | | - - Theme parameters and UI settings |
65 | | - - Currently shows version `0.13` |
66 | | - |
67 | | -- **`package.json`** - Node.js dependencies for CSS processing (postcss, autoprefixer) |
68 | 20 |
|
69 | | -- **`.editorconfig`** - Code style rules (UTF-8, LF line endings, spaces for indentation) |
| 21 | +# Clean build |
| 22 | +rm -rf public/ |
70 | 23 |
|
71 | | -- **`contribution.md`** - Contributing guide (Chinese/English mixed) |
| 24 | +# Production build with garbage collection |
| 25 | +HUGO_ENV="production" hugo --gc |
72 | 26 |
|
73 | | -- **`maturity.md`** - Project maturity assessment documentation |
| 27 | +# Custom server configuration |
| 28 | +hugo server -b http://127.0.0.1 -p 80 --bind=0.0.0.0 |
| 29 | +``` |
74 | 30 |
|
75 | | -## Content Organization |
| 31 | +## Prerequisites |
76 | 32 |
|
77 | | -Documentation is organized into major sections: |
| 33 | +- **Hugo Extended** v0.95.0 recommended (v0.102.3 in CI) - must be the "extended" version for SASS/SCSS support |
| 34 | +- **Node.js** v16+ and npm |
| 35 | +- Download Hugo from: https://github.com/gohugoio/hugo/releases |
78 | 36 |
|
79 | | -- **`quickstart/`** - Getting started guides for HugeGraph components (Server, Loader, Hubble, Tools, Computer, AI) |
80 | | -- **`config/`** - Configuration documentation |
81 | | -- **`clients/`** - Client API documentation (Gremlin Console, RESTful API) |
82 | | -- **`guides/`** - User guides and tutorials |
83 | | -- **`performance/`** - Performance benchmarks and optimization |
84 | | -- **`language/`** - Query language documentation |
85 | | -- **`contribution-guidelines/`** - How to contribute to HugeGraph |
86 | | -- **`changelog/`** - Release notes and version history |
87 | | -- **`download/`** - Download links and instructions |
| 37 | +## Architecture |
88 | 38 |
|
89 | | -## Common Tasks |
| 39 | +``` |
| 40 | +content/ |
| 41 | +├── cn/ # Chinese documentation (default language) |
| 42 | +│ ├── docs/ # Main documentation |
| 43 | +│ ├── blog/ # Blog posts |
| 44 | +│ ├── community/ |
| 45 | +│ └── about/ |
| 46 | +└── en/ # English documentation (parallel structure) |
| 47 | +
|
| 48 | +themes/docsy/ # Docsy theme (submodule) |
| 49 | +layouts/ # Custom template overrides |
| 50 | +assets/ # Processed assets (SCSS, images) |
| 51 | +static/ # Static files served directly |
| 52 | +config.toml # Main site configuration |
| 53 | +``` |
90 | 54 |
|
91 | | -### Building and Testing |
| 55 | +### Content Structure |
92 | 56 |
|
93 | | -```bash |
94 | | -# Build for production (with minification) |
95 | | -hugo --minify |
| 57 | +Documentation sections in `content/{cn,en}/docs/`: |
| 58 | +- `quickstart/` - Getting started guides for HugeGraph components |
| 59 | +- `config/` - Configuration documentation |
| 60 | +- `clients/` - Client API documentation (Gremlin, RESTful) |
| 61 | +- `guides/` - User guides and tutorials |
| 62 | +- `performance/` - Benchmarks and optimization |
| 63 | +- `language/` - Query language docs |
| 64 | +- `contribution-guidelines/` - Contributing guides |
| 65 | +- `changelog/` - Release notes |
| 66 | +- `download/` - Download instructions |
96 | 67 |
|
97 | | -# Clean previous build |
98 | | -rm -rf public/ |
| 68 | +## Key Configuration Files |
99 | 69 |
|
100 | | -# Build with specific environment |
101 | | -HUGO_ENV="production" hugo --gc |
102 | | -``` |
| 70 | +- `config.toml` - Site-wide settings, language config, menu structure, version (currently 0.13) |
| 71 | +- `package.json` - Node dependencies for CSS processing (postcss, autoprefixer, mermaid) |
| 72 | +- `.editorconfig` - UTF-8, LF line endings, spaces for indentation |
103 | 73 |
|
104 | | -### Working with Content |
| 74 | +## Working with Content |
105 | 75 |
|
106 | 76 | When editing documentation: |
107 | | - |
108 | 77 | 1. Maintain parallel structure between `content/cn/` and `content/en/` |
109 | | -2. Use Markdown format for all documentation files |
110 | | -3. Include front matter in each file (title, weight, description) |
111 | | -4. For translated content, ensure both Chinese and English versions are updated |
112 | | - |
113 | | -### Theme Customization |
114 | | - |
115 | | -- Global site config: `config.toml` (root directory) |
116 | | -- Theme-specific config: `themes/docsy/config.toml` |
117 | | -- Custom layouts: Place in `layouts/` to override theme defaults |
118 | | -- Custom styles: Modify files in `assets/` directory |
119 | | - |
120 | | -Refer to [Docsy documentation](https://www.docsy.dev/docs/) for theme customization details. |
| 78 | +2. Use Markdown with Hugo front matter (title, weight, description) |
| 79 | +3. For bilingual changes, update both Chinese and English versions |
| 80 | +4. Include mermaid diagrams where appropriate (mermaid.js is available) |
121 | 81 |
|
122 | 82 | ## Deployment |
123 | 83 |
|
124 | | -The site uses GitHub Actions for CI/CD (`.github/workflows/hugo.yml`): |
125 | | - |
126 | | -1. **Triggers**: On push to `master` branch or pull requests |
127 | | -2. **Build process**: |
128 | | - - Checkout with submodules (for themes) |
129 | | - - Setup Node v16 and Hugo v0.102.3 extended |
130 | | - - Run `npm i && hugo --minify` |
131 | | -3. **Deployment**: Publishes to `asf-site` branch (GitHub Pages) |
132 | | - |
133 | | -The deployed site is hosted as part of Apache HugeGraph's documentation infrastructure. |
134 | | - |
135 | | -## HugeGraph Architecture Context |
136 | | - |
137 | | -This documentation covers the complete HugeGraph ecosystem: |
138 | | - |
139 | | -- **HugeGraph-Server** - Core graph database engine with REST API |
140 | | -- **HugeGraph-Store** - Distributed storage engine with integrated computation |
141 | | -- **HugeGraph-PD** - Placement Driver for metadata management |
142 | | -- **HugeGraph-Toolchain**: |
143 | | - - Client (Java RESTful API client) |
144 | | - - Loader (data import tool) |
145 | | - - Hubble (web visualization platform) |
146 | | - - Tools (deployment and management utilities) |
147 | | -- **HugeGraph-Computer** - Distributed graph processing system (OLAP) |
148 | | -- **HugeGraph-AI** - Graph neural networks and LLM/RAG components |
| 84 | +- **CI/CD**: GitHub Actions (`.github/workflows/hugo.yml`) |
| 85 | +- **Trigger**: Push to `master` branch or pull requests |
| 86 | +- **Build**: `npm i && hugo --minify` with Node v16 and Hugo v0.102.3 extended |
| 87 | +- **Deploy**: Publishes to `asf-site` branch (GitHub Pages) |
| 88 | +- **PR Requirements**: Include screenshots showing before/after changes |
149 | 89 |
|
150 | | -## Git Workflow |
| 90 | +## HugeGraph Ecosystem Context |
151 | 91 |
|
152 | | -- **Main branch**: `master` (protected, triggers deployment) |
153 | | -- **PR requirements**: Include screenshots showing before/after changes in documentation |
154 | | -- **Commit messages**: Follow Apache commit conventions |
155 | | -- Always create a new branch from `master` for changes |
156 | | -- Deployment to `asf-site` branch is automated via GitHub Actions |
| 92 | +This documentation covers: |
| 93 | +- **HugeGraph-Server** - Core graph database with REST API |
| 94 | +- **HugeGraph-Store** - Distributed storage engine |
| 95 | +- **HugeGraph-PD** - Placement Driver for metadata |
| 96 | +- **Toolchain** - Client, Loader, Hubble (web UI), Tools |
| 97 | +- **HugeGraph-Computer** - Distributed OLAP graph processing |
| 98 | +- **HugeGraph-AI** - GNN, LLM/RAG components |
157 | 99 |
|
158 | 100 | ## Troubleshooting |
159 | 101 |
|
160 | | -**Error: "TOCSS: failed to transform scss/main.scss"** |
161 | | -- Cause: Using standard Hugo instead of Hugo Extended |
162 | | -- Solution: Install Hugo Extended version |
| 102 | +**"TOCSS: failed to transform scss/main.scss"** |
| 103 | +- Install Hugo Extended (not standard Hugo) |
163 | 104 |
|
164 | | -**Error: Module/theme not found** |
165 | | -- Cause: Git submodules not initialized |
166 | | -- Solution: `git submodule update --init --recursive` |
| 105 | +**Theme/module not found** |
| 106 | +- Run: `git submodule update --init --recursive` |
167 | 107 |
|
168 | | -**Build fails in CI but works locally** |
169 | | -- Check Hugo version match (CI uses v0.102.3) |
170 | | -- Ensure npm dependencies are installed |
171 | | -- Verify Node.js version (CI uses v16) |
| 108 | +**CI build fails but works locally** |
| 109 | +- Match Hugo version (v0.102.3) and Node.js (v16) |
| 110 | +- Verify npm dependencies are installed |
0 commit comments