Complete Tasks 1-5 of the Hugo-native API migration:
- Promote Hugo-native templates from POC to production location
- Remove RapiDoc templates (rapidoc.html, rapidoc-tag.html, rapidoc-mini.html)
- Remove RapiDoc JS components (api-rapidoc.ts, rapidoc-mini.ts)
- Clean up generation scripts (~200 lines of dead code removed)
- Rewrite Cypress tests for standard HTML (no shadow DOM)
Templates moved from layouts/partials/api/hugo-native/ to parent.
All verifications pass (Hugo build, TypeScript compilation).
Replace unreliable findRE regex with split-based path extraction for
version detection in API section index pages. The previous regex
"[^/]+.*?" was inconsistent and could fail to extract version correctly.
Changes:
- layouts/_default/api.html: Add dual-button logic for clustered/cloud-dedicated
section index pages using split-based URL path extraction
- layouts/api/list.html: Replace findRE with split for version extraction
- layouts/api/section.html: Add dual-button logic matching api.html
The split approach extracts path segments reliably:
/influxdb3/clustered/api/ → ["", "influxdb3", "clustered", "api", ""]
$version = index 2 = "clustered"
- Always show children after content (was showing either/or)
- Use children-links class for arrow indicator styling
- Truncate descriptions to first paragraph and 200 chars
- Apply markdownify filter for proper markdown rendering
* fix(api): refine .IsSection check to prevent breaking endpoint pages
The previous commit added an .IsSection check that correctly fixed
section index pages but inadvertently broke endpoint pages that Hugo
classifies as sections.
This commit refines the conditional to check for the absence of the
staticFilePath parameter, which distinguishes true section index pages
from endpoint pages that need the RapiDoc renderer:
- Section pages (no staticFilePath): Show children listing
- Endpoint pages (with staticFilePath): Use RapiDoc renderer
Fixes the regression introduced in commit 59daf17.
* chore: update Scalar references to RapiDoc in comments
Update code comments and documentation to accurately reflect that
the API documentation uses RapiDoc, not Scalar:
- api-docs/scripts/generate-openapi-articles.ts: Update JSDoc comments
- api-docs/scripts/dist/generate-openapi-articles.js: Update compiled version
- assets/js/components/api-toc.ts: Update implementation comment
- .claude/agents/ts-component-dev.md: Update component reference
- .claude/skills/hugo-template-dev/SKILL.md: Update component reference
The implementation uses RapiDoc throughout, so these comments needed
to be corrected for accuracy.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Update Hugo templates to correctly display API children listing on
section index pages (/influxdb3/core/api/, /influxdb3/enterprise/api/)
instead of the RapiDoc renderer.
- Create layouts/api/section.html for API section pages
- Update layouts/_default/api.html to detect section pages and render
content directly instead of using RapiDoc
- Clean up layouts/api/list.html debug comment
The issue was that layouts/_default/api.html took precedence over
layouts/api/list.html for section pages due to Hugo's type-based
template lookup. The fix adds .IsSection check to delegate section
pages to appropriate rendering logic.
Replace legacy API documentation approach with modern Scalar-based rendering:
## Architecture Changes
- Add renderer abstraction (`layouts/partials/api/`) supporting Scalar and RapiDoc
- Create `api` layout type for API reference pages (single.html, list.html)
- Configure renderer via `site.Params.apiRenderer` (default: scalar)
## OpenAPI Processing Pipeline (TypeScript)
- `api-docs/scripts/generate-openapi-articles.ts` - Main generation script
- `api-docs/scripts/openapi-paths-to-hugo-data/` - OpenAPI to Hugo data converter
- Generates per-endpoint path fragments for AI agent access
- Creates Hugo content pages with `type: api` frontmatter
## AI Agent Accessibility
- Full specs at `/openapi/influxdb-{product}.yml` and `.json`
- Per-endpoint fragments at `/openapi/influxdb-{product}/paths/`
- `<link rel="alternate">` tags in HTML for machine discovery
## Scalar Features
- Dark/light theme support synchronized with site theme
- InfluxData brand colors
- Responsive layout
- Download link for OpenAPI spec
## Products Supported
- cloud-v2, oss-v2
- influxdb3-core, influxdb3-enterprise
- cloud-dedicated, cloud-serverless, clustered
Usage: node api-docs/scripts/dist/generate-openapi-articles.js [product]