Skip to content

Commit d53ea58

Browse files
authored
feat: migrate from hash routing to pathname routing (EN+VI+ZH) (#40)
Replace hash-based doc navigation (#installation) with pathname routing (/installation) using history.pushState + popstate. This frees the hash for in-page anchors, fixing ToC (Table of Contents) scroll behavior. Changes: - Rewrite routing logic in docs-app.js (pushState, popstate, navigateTo) - Add section aliases (/getting-started → first page of section) - Add backward compat for old #hash URLs (auto-redirect) - Convert ~361 cross-doc links from ](#key) to ](/key) across EN/VI/ZH - Add _redirects for Cloudflare Pages SPA fallback + 404.html safety net - Make llms.txt sidebar links language-aware (vi/llms.txt, zh/llms.txt) - Regenerate llms-full.txt for all languages - Update docs-audit skill: add ZH sync check, add missing source mappings
1 parent 59d81bc commit d53ea58

349 files changed

Lines changed: 2830 additions & 2502 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/goclaw-docs-audit/SKILL.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,14 @@ Source of truth mapping (`$GOCLAW_SOURCE/docs/`):
104104
| `19-websocket-rpc.md` | WebSocket RPC methods |
105105
| `20-api-keys-auth.md` | API keys, authentication |
106106

107-
### Step 5: Check EN-VI Sync Status
107+
### Step 5: Check EN-VI-ZH Sync Status
108108

109109
For each matched docs page in the goclaw-docs repo:
110110
- Get last modification date of the EN file (e.g., `getting-started/quick-start.md`)
111111
- Get last modification date of the VI file (e.g., `vi/getting-started/quick-start.md`)
112-
- If VI is older than EN, or VI doesn't exist: mark as "Outdated"
113-
- If VI is same date or newer: mark as "Synced"
112+
- Get last modification date of the ZH file (e.g., `zh/getting-started/quick-start.md`)
113+
- If VI/ZH is older than EN, or doesn't exist: mark as "Outdated"
114+
- If VI/ZH is same date or newer: mark as "Synced"
114115

115116
Use `git log -1 --format=%cd --date=short -- <file>` to get last modification dates.
116117

@@ -137,11 +138,11 @@ Create a markdown report with this format:
137138
| agents/creating-agents.md | 01-agent-loop.md | Accurate ||
138139
| core-concepts/tools-overview.md | 03-tools-system.md | Discrepancy | Missing new tool type "x" |
139140

140-
## EN-VI Sync Status
141+
## EN-VI-ZH Sync Status
141142

142-
| EN Page | Last EN Update | Last VI Update | Status |
143-
|---|---|---|---|
144-
| getting-started/quick-start.md | 2026-03-07 | 2026-03-01 | Outdated |
143+
| EN Page | Last EN | Last VI | VI Status | Last ZH | ZH Status |
144+
|---|---|---|---|---|---|
145+
| getting-started/quick-start.md | 2026-03-07 | 2026-03-01 | Outdated | 2026-03-07 | Synced |
145146

146147
## Recommended Actions
147148
1. Review `agents/creating-agents.md` — agent creation flow changed

.claude/skills/goclaw-docs-audit/mapping.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
{"pattern": "internal/knowledgegraph/*", "docs": ["advanced/knowledge-graph.md"], "priority": "medium"},
4040
{"pattern": "internal/i18n/*", "docs": ["core-concepts/multi-tenancy.md"], "priority": "low"},
4141
{"pattern": "internal/upgrade/*", "docs": ["deployment/upgrading.md"], "priority": "medium"},
42-
{"pattern": "internal/http/*", "docs": ["reference/rest-api.md", "advanced/api-keys-rbac.md"], "priority": "medium"}
42+
{"pattern": "internal/http/*", "docs": ["reference/rest-api.md", "advanced/api-keys-rbac.md"], "priority": "medium"},
43+
{"pattern": "internal/providerresolve/*", "docs": ["providers/overview.md", "core-concepts/how-goclaw-works.md"], "priority": "medium"},
44+
{"pattern": "internal/edition/*", "docs": ["core-concepts/multi-tenancy.md"], "priority": "low"},
45+
{"pattern": "internal/heartbeat/*", "docs": ["advanced/heartbeat.md"], "priority": "low"},
46+
{"pattern": "internal/channels/websocket/*", "docs": ["channels/websocket.md", "channels/browser-pairing.md"], "priority": "medium"}
4347
],
4448
"source_of_truth": "docs/",
4549
"_source_of_truth_note": "Relative to $GOCLAW_SOURCE (resolved from GOCLAW_SOURCE_PATH env var or ../goclaw/ fallback)"

404.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<script>
6+
// Preserve path so SPA can route after redirect
7+
sessionStorage.setItem('redirect-path', window.location.pathname + window.location.hash);
8+
window.location.replace('/');
9+
</script>
10+
</head>
11+
<body></body>
12+
</html>

_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* /index.html 200

advanced/api-keys-rbac.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ When a key is created or revoked, a `cache.invalidate` event is broadcast on the
254254

255255
## What's Next
256256

257-
- [Authentication & OAuth](#authentication) — gateway token and OAuth flow
258-
- [Exec Approval](#exec-approval) — require `operator.approvals` scope
259-
- [Security Hardening](#deploy-security) — full 5-layer permission overview
257+
- [Authentication & OAuth](/authentication) — gateway token and OAuth flow
258+
- [Exec Approval](/exec-approval) — require `operator.approvals` scope
259+
- [Security Hardening](/deploy-security) — full 5-layer permission overview
260260
- [CLI Credentials](./cli-credentials.md) — SecureCLI: inject credentials into CLI tools (gh, aws, gcloud) without exposing secrets to the agent
261261

262262
<!-- goclaw-source: 57754a5 | updated: 2026-03-23 -->

advanced/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ source .env.local
192192

193193
## What's Next
194194

195-
- [Providers Overview](#providers-overview) — all supported LLM providers and how to configure them
196-
- [Hooks & Quality Gates](#hooks-quality-gates) — add validation to agent outputs
195+
- [Providers Overview](/providers-overview) — all supported LLM providers and how to configure them
196+
- [Hooks & Quality Gates](/hooks-quality-gates) — add validation to agent outputs
197197

198198
<!-- goclaw-source: 57754a5 | updated: 2026-03-18 -->

advanced/browser-automation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ Returns:
253253

254254
## What's Next
255255

256-
- [Exec Approval](#exec-approval) — require human sign-off before running commands
257-
- [Hooks & Quality Gates](#hooks-quality-gates) — add pre/post checks to agent actions
256+
- [Exec Approval](/exec-approval) — require human sign-off before running commands
257+
- [Hooks & Quality Gates](/hooks-quality-gates) — add pre/post checks to agent actions
258258

259259
<!-- goclaw-source: 57754a5 | updated: 2026-03-18 -->

advanced/caching.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Both backends implement the same interface:
8888

8989
## What's Next
9090

91-
- [Database Setup](#deploy-database) — PostgreSQL configuration
92-
- [Production Checklist](#deploy-checklist) — Deploy with confidence
91+
- [Database Setup](/deploy-database) — PostgreSQL configuration
92+
- [Production Checklist](/deploy-checklist) — Deploy with confidence
9393

9494
<!-- goclaw-source: 57754a5 | updated: 2026-03-18 -->

advanced/channel-instances.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ DELETE /v1/channels/instances/{id}/writers/{userId}?group_id=<group_id>
244244

245245
## What's Next
246246

247-
- [Channel Overview](#channels-overview)
248-
- [Multi-Channel Setup](#recipe-multi-channel)
249-
- [Multi-Tenancy](#multi-tenancy)
247+
- [Channel Overview](/channels-overview)
248+
- [Multi-Channel Setup](/recipe-multi-channel)
249+
- [Multi-Tenancy](/multi-tenancy)
250250

251251
<!-- goclaw-source: 57754a5 | updated: 2026-03-18 -->

advanced/cli-credentials.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ CLI Credentials let you define named credential sets (API keys, tokens, connecti
1010

1111
## What's Next
1212

13-
- [Exec Approval](#exec-approval)
14-
- [API Keys & RBAC](#api-keys-rbac)
15-
- [Security Hardening](#deploy-security)
13+
- [Exec Approval](/exec-approval)
14+
- [API Keys & RBAC](/api-keys-rbac)
15+
- [Security Hardening](/deploy-security)
1616

1717
<!-- goclaw-source: 57754a5 | updated: 2026-03-18 -->

0 commit comments

Comments
 (0)