Migrate API reference docs to Hugo-native for improved site integration#6622
Migrate API reference docs to Hugo-native for improved site integration#6622jstirnaman wants to merge 220 commits intomasterfrom
Conversation
Code reviewFound 1 issue:
docs-v2/layouts/partials/api/rapidoc.html Lines 95 to 110 in 90044bd 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
3c7ad96 to
4fccddc
Compare
|
📦 PR Preview — Preview Bot
Pages included in this preview
Preview auto-deploys on push. Will be cleaned up when PR closes. |
|
Works with Core and Enterprise, currently. Deployed to staging. |
|
@claude The last commit fixed the children list in the /api/ section page template, but broke the endpoint page template. Analyze. |
✅ |
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]
- latest-patch.html: Replace deprecated .Store with local variable assignment. The .Store method was removed from shortcode context in newer Hugo versions. - api-endpoint.html: Add nil check for productRef lookup to prevent index errors when productKey is not in productAliases dictionary. Falls back to "influxdb" as default product reference.
- yarn build:api-docs: Generate API docs for all products - yarn build:api-docs cloud-v2: Generate for specific product - yarn build:api-docs:compile: Recompile TypeScript if modified
…. Split ui-dev subagent into hugo-, ts-, and testing-specific agents.
- Add CSS for operations list cards with method badges, paths, and summaries - Remove duplicate Overview section from list.html (was duplicating summary) - Split "Data Operations" into separate nav groups: Write data, Query data, Cache data
- Add support for tag-based article generation with operations metadata - Generate articles.yml data files with tag, menuName, and isConceptual fields - Include operations array in frontmatter for tag pages
- Rewrite single.html for operation pages with RapiDoc integration - Simplify rapidoc.html partial for tag-based rendering - Add sidebar-nav include to sidebar.html for API navigation - Add tab-panels.html and tabs.html for content organization
- Add api-nav.ts for sidebar navigation collapse/expand - Add api-scalar.ts for Scalar API renderer integration - Add api-tabs.ts for tab switching functionality - Add api-toc.ts for table of contents generation - Register components in main.js
- Add YAML article data files for all InfluxDB products - Add sidebar-nav.html partial for API navigation rendering - Rename data directory from article-data to article_data for Hugo compatibility - Remove obsolete JSON articles file
- Update hugo.yml config for API docs settings - Simplify _api-overrides.scss (removed hardcoded content styles) - Import _api-layout.scss in styles-default.scss - Update API landing pages for Core and Enterprise with redirects - Update OpenAPI spec files - Update dependencies
- Update tests for new tag-based API page structure - Add tests for operations list rendering - Add tests for sidebar navigation groups
…tion - Header summary now shows only the first sentence from description using regex extraction with fallback to first line for descriptions without sentence-ending punctuation - Added Overview section with full description after endpoints list
- Sidebar nav now shows operations with method badges and paths instead of duplicating tag names when groups are expanded - Added background color to nav group items to match sidebar - Increased max-height for expanded groups to accommodate all operations - Added styles for operation items in sidebar nav (.api-nav-operation) - Fixed summary paragraph width by setting flex-basis to 100%
Replace faint link with a small bordered button that has good contrast in both light and dark modes.
These v2/cloud tags pages use an old layout that causes Hugo to panic during live rebuilds when generated API content is present.
…line Remove dead Redoc HTML generation code (generateRedocHtml, template.hbs, redoc-static.html gitignore entry) and update all documentation and agent files to reflect the Hugo-native API rendering pipeline. Also fix pre-existing YAML frontmatter quoting in agent descriptions and remove unused eslint-disable directives in ask-ai.ts.
This reverts commit d2e9ba5.
…rverless Restructure API reference docs for consistency across all InfluxDB products: - Align Enterprise tags with Core (13 matching tags via rename/reassign) - Add nested Data API / Management API sidebar for Cloud Dedicated and Clustered - Drop 29 unsupported TSM-era tags from Cloud Serverless, add Note callout - Mirror data paths to content paths (remove articleDataKey indirection) - Fix specDownloadPath for single-spec products with displayName - Add reassign and drop features to post-process-specs.ts tags.yml config - Add data-driven Cypress tests for sidebar nav and conceptual page content - Fix response description markdown rendering
Brings in tag alignment, multi-spec sidebar, Cloud Serverless cleanup, data path restructuring, and data-driven Cypress tests.
# Conflicts: # .github/workflows/doc-review.yml # AGENTS.md # PLAN.md # assets/js/content-interactions.js # data/products.yml
Hugo 0.157.0 panics with "nil walk context" during fast render rebuild when generated API content pages are present. Use --disableFastRender for the Cypress test server to avoid this.
Vale Style Check Results
Warnings (79)
Showing first 20 of 79 warnings. ✅ Check passed |
…dd HEAD badge - Drop 29 unsupported TSM-era tags from Cloud Serverless via tags.yml drop config - Add Note callout on Cloud Serverless landing page directing to Cloud (TSM) reference - Fix Cloud Serverless terminology (databases → buckets, organizations) - Widen right-side TOC (200px → 260px) for readable operation summaries - Add HEAD method badge color (#00897B teal) - Update api-docs/README.md: remove outdated Redoc plugin/decorator docs, add overlay table - Update .github/instructions: fix Redocly → @redocly/cli - Rename and slim analyze-api-source agent → analyze-api-specs (remove README duplication) - Update PLAN.md: clarify @redocly/cli is bundling only, not rendering
…ildren extraction - Add article/feedback.html partial to all 5 API layouts (was missing) - Add ESLint config block for api-docs/scripts with Node globals and correct tsconfig - Disable no-undef for api-docs scripts (TypeScript handles it) - Fix unused vars (prefix with _) - Fix section-children description extraction for single-newline descriptions (Enterprise v1 Write tag had heading/bullets in one block)
… Bearer scheme name - Sort tag page operations: /api/v3 first, /api/v2 second, legacy paths last - Render x-compatibility-version badges (v1/v2) on operation headers - Fix BearerAuthentication displaying as raw identifier on v3 auth pages
…cation display - Fix hugo-template-dev skill: remove nonexistent api-rapidoc.ts, add _api-operations.scss, add api-docs/README.md reference - Fix content-editing skill: correct API test sentinel path (reference/api → api) - Fix security-schemes.html: add BearerAuthentication display name mapping
Configure Hugo dev server (port 1313) and test server (port 1315) for Claude Preview integration.
…pi-uplift # Conflicts: # PLAN.md # PLATFORM_REFERENCE.md # api-docs/influxdb3/core/influxdb3-core-openapi.yaml # api-docs/influxdb3/enterprise/influxdb3-enterprise-openapi.yaml


API reference uplift
Replace Redoc with Hugo-native templates for API reference documentation. Operations render as standard HTML — no shadow DOM, no client-side rendering.
Hugo-native layout
layouts/partials/api/)/influxdb3/core/api/database/)Inline curl examples
{baseurl}→ default fromspec.servers[0].variables)$refresolution for parameters, request bodies, and schemasexample→default→enum[0]→ type placeholder)text/plaincontent typesinfluxdb-url.jsautomatically personalizes placeholder hostsAsk AI integration
ask-ai-openclass +data-queryattribute)ask-ai-trigger.jsRelated links
x-influxdata-relatedfrontmatterVisual improvements
#D63031) vs 4xx errors (warm orange#E17055)2pxborder, increased padding)Build and generation
yarn build:api-docsparses OpenAPI specs into Hugo data and generates content pages--cleanflag (default) removes stale files when tags are renamed or removed--dry-runflag previews what would be deleted