Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/auto-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

name: "Auto PR Commenter"
name: "Auto PR AI Review"

on:
pull_request_target:
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ nohup.out
.idea/

.DS_Store

# AI Agent Configuration Files
# Keep AGENTS.md as the source of truth, ignore tool-specific symlinks/configs
CLAUDE.md
GEMINI.md
.cursorrules
.cursor/
.github/copilot-instructions.md
.vscode/settings.json
.aider*
.gemini/
171 changes: 171 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# AI Development Agent Instructions

This file provides guidance to AI coding assistants (Claude Code, Cursor, GitHub Copilot, etc.) when working with code in this repository.

## Project Overview

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.

The documentation is multilingual, supporting both **Chinese (cn)** and **English (en)** content.

## Development Setup

### Prerequisites

1. **Hugo Extended** (v0.95.0 recommended, v0.102.3 used in CI)
- Must be the "extended" version (includes SASS/SCSS support)
- Download from: https://github.com/gohugoio/hugo/releases
- Install location: `/usr/bin` or `/usr/local/bin`

2. **Node.js and npm** (v16+ as specified in CI)

### Quick Start

```bash
# Install npm dependencies (autoprefixer, postcss, postcss-cli)
npm install

# Start local development server (with auto-reload)
hugo server

# Custom server with different ip/port
hugo server -b http://127.0.0.1 -p 80 --bind=0.0.0.0

# Build production site (output to ./public)
hugo --minify
```

## Project Structure

### Key Directories

- **`content/`** - All documentation content in Markdown
- `content/cn/` - Chinese (simplified) documentation
- `content/en/` - English documentation
- Each language has parallel structure: `docs/`, `blog/`, `community/`, `about/`

- **`themes/docsy/`** - The Docsy Hugo theme (submodule or vendored)

- **`static/`** - Static assets (images, files) served directly

- **`assets/`** - Assets processed by Hugo pipelines (SCSS, images for processing)

- **`layouts/`** - Custom Hugo template overrides for the Docsy theme

- **`public/`** - Generated site output (gitignored, created by `hugo` build)

- **`dist/`** - Additional distribution files

### Important Files

- **`config.toml`** - Main site configuration
- Defines language settings (cn as default, en available)
- Menu structure and navigation
- Theme parameters and UI settings
- Currently shows version `0.13`

- **`package.json`** - Node.js dependencies for CSS processing (postcss, autoprefixer)

- **`.editorconfig`** - Code style rules (UTF-8, LF line endings, spaces for indentation)

- **`contribution.md`** - Contributing guide (Chinese/English mixed)

- **`maturity.md`** - Project maturity assessment documentation

## Content Organization

Documentation is organized into major sections:

- **`quickstart/`** - Getting started guides for HugeGraph components (Server, Loader, Hubble, Tools, Computer, AI)
- **`config/`** - Configuration documentation
- **`clients/`** - Client API documentation (Gremlin Console, RESTful API)
- **`guides/`** - User guides and tutorials
- **`performance/`** - Performance benchmarks and optimization
- **`language/`** - Query language documentation
- **`contribution-guidelines/`** - How to contribute to HugeGraph
- **`changelog/`** - Release notes and version history
- **`download/`** - Download links and instructions

## Common Tasks

### Building and Testing

```bash
# Build for production (with minification)
hugo --minify

# Clean previous build
rm -rf public/

# Build with specific environment
HUGO_ENV="production" hugo --gc
```

### Working with Content

When editing documentation:

1. Maintain parallel structure between `content/cn/` and `content/en/`
2. Use Markdown format for all documentation files
3. Include front matter in each file (title, weight, description)
4. For translated content, ensure both Chinese and English versions are updated

### Theme Customization

- Global site config: `config.toml` (root directory)
- Theme-specific config: `themes/docsy/config.toml`
- Custom layouts: Place in `layouts/` to override theme defaults
- Custom styles: Modify files in `assets/` directory

Refer to [Docsy documentation](https://www.docsy.dev/docs/) for theme customization details.

## Deployment

The site uses GitHub Actions for CI/CD (`.github/workflows/hugo.yml`):

1. **Triggers**: On push to `master` branch or pull requests
2. **Build process**:
- Checkout with submodules (for themes)
- Setup Node v16 and Hugo v0.102.3 extended
- Run `npm i && hugo --minify`
3. **Deployment**: Publishes to `asf-site` branch (GitHub Pages)

The deployed site is hosted as part of Apache HugeGraph's documentation infrastructure.

## HugeGraph Architecture Context

This documentation covers the complete HugeGraph ecosystem:

- **HugeGraph-Server** - Core graph database engine with REST API
- **HugeGraph-Store** - Distributed storage engine with integrated computation
- **HugeGraph-PD** - Placement Driver for metadata management
- **HugeGraph-Toolchain**:
- Client (Java RESTful API client)
- Loader (data import tool)
- Hubble (web visualization platform)
- Tools (deployment and management utilities)
- **HugeGraph-Computer** - Distributed graph processing system (OLAP)
- **HugeGraph-AI** - Graph neural networks and LLM/RAG components

## Git Workflow

- **Main branch**: `master` (protected, triggers deployment)
- **PR requirements**: Include screenshots showing before/after changes in documentation
- **Commit messages**: Follow Apache commit conventions
- Always create a new branch from `master` for changes
- Deployment to `asf-site` branch is automated via GitHub Actions

## Troubleshooting

**Error: "TOCSS: failed to transform scss/main.scss"**
- Cause: Using standard Hugo instead of Hugo Extended
- Solution: Install Hugo Extended version

**Error: Module/theme not found**
- Cause: Git submodules not initialized
- Solution: `git submodule update --init --recursive`

**Build fails in CI but works locally**
- Check Hugo version match (CI uses v0.102.3)
- Ensure npm dependencies are installed
- Verify Node.js version (CI uses v16)
2 changes: 1 addition & 1 deletion content/cn/docs/guides/backup-restore.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Backup Restore"
linkTitle: "备份 & 恢复"
weight: 4
weight: 5
---

## 描述
Expand Down
2 changes: 1 addition & 1 deletion content/cn/docs/guides/faq.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "FAQ"
linkTitle: "FAQ"
weight: 5
weight: 6
---

- 如何选择后端存储? 选 RocksDB 还是 Cassandra 还是 Hbase 还是 Mysql?
Expand Down
2 changes: 1 addition & 1 deletion content/cn/docs/guides/security.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "报告安全问题"
linkTitle: "安全公告"
weight: 6
weight: 7
---

## 报告 Apache HugeGraph 的安全问题
Expand Down
Loading
Loading