docs-v2/assets/js
Jason Stirnaman f5535c9d5c feat(api): Hugo-native API reference rendering
Hugo-native templates for API
reference documentation. Operations render as server-side HTML instead
of client-side Redoc, providing faster page loads, full SEO
indexability, and consistent styling.

Architecture:
- Tag-based navigation: operations grouped by OpenAPI tag, accessed
  via tag pages only (no individual operation URLs)
- Generation script auto-discovers products from .config.yml files,
  deriving Hugo paths and menu keys from directory structure
- Per-tag JSON/YAML chunks for fast Hugo template rendering
- Inline curl examples generated from OpenAPI specs at build time

Templates (layouts/api/, layouts/partials/api/):
- tag-renderer.html: renders all operations for a tag
- operation.html: individual operation with parameters, request body,
  responses, and schema rendering
- code-sample.html: curl examples with Ask AI integration
- section-children.html: tag listing on section index pages
- all-endpoints-list.html: all operations sorted by path

Generation (api-docs/scripts/generate-openapi-articles.ts):
- Auto-discovery from .config.yml replaces hardcoded productConfigs
- Each API section generates independently (no cross-spec merging)
- Frontmatter-driven template data (specDownloadPath, articleDataKey)
- Link transformation: /influxdb/version/ placeholders resolved to
  product-specific paths

Removed:
- Redoc renderer, JavaScript components, and CSS
- Shadow DOM test infrastructure (~160 lines)
- Operation page generation (dead generatePathPages function)
- mergeArticleData() and slugifyDisplayName()

Styles (assets/styles/layouts/_api-*.scss):
- 3-column layout: sidebar, content, sticky TOC
- Theme-aware code blocks for curl examples
- Method badges (GET/POST/PUT/DELETE) with color coding
- Collapsible schema sections with depth tracking

Tests (cypress/e2e/content/api-reference.cy.js):
- Tag page rendering with operation structure
- Download button verification per section
- All-endpoints page with operation cards
- Related links from x-related OpenAPI extension
- Code sample and Ask AI link validation
2026-03-15 22:17:33 -05:00
..
components feat(api): Hugo-native API reference rendering 2026-03-15 22:17:33 -05:00
services chore(js): Extract Hugo params imports to single-purpose modules, fix environment-specific Hugo configs, use Hugo environments instead of specifying the config file, configure source maps and ESM for development and testing 2025-06-09 16:46:26 -05:00
utils Telegraf Controller (alpha) Documentation (#6685) 2025-12-31 14:49:32 -07:00
api-libs.js chore(js): Extract Hugo params imports to single-purpose modules, fix environment-specific Hugo configs, use Hugo environments instead of specifying the config file, configure source maps and ESM for development and testing 2025-06-09 16:46:26 -05:00
ask-ai-trigger.js fix(version-detector): centralize Grafana links and DRY up host examples (#6693) 2026-01-26 18:42:09 -06:00
ask-ai.ts feat: add InfluxDB documentation MCP server integration (#6830) 2026-02-17 20:42:56 -06:00
code-controls.js hotfix(analytics): typo 2025-07-14 13:11:24 -05:00
code-placeholders.js chore(code-placeholders): Support path-like patterns: 2025-04-23 10:27:20 -05:00
content-interactions.js feat(api): Hugo-native API reference rendering 2026-03-15 22:17:33 -05:00
custom-timestamps.js InfluxDB 3 Explorer 1.2 (#6350) 2025-08-29 08:44:59 -06:00
datetime.js Update assets/js/datetime.js 2025-06-09 17:17:34 -05:00
feature-callouts.js chore(js): Extract Hugo params imports to single-purpose modules, fix environment-specific Hugo configs, use Hugo environments instead of specifying the config file, configure source maps and ESM for development and testing 2025-06-09 16:46:26 -05:00
flux-group-keys.js Merge pull request #6079 from influxdata/chore-js-refactor-footer-scripts-modules 2025-06-09 14:40:37 -05:00
flux-influxdb-versions.js fix(flux-influxdb-versions): Fixes modal trigger for flux-influxdb-versions and refactors the trigger to a component. 2025-03-27 20:10:13 -05:00
helpers.js Initial Kapa.ai chat integration. 2025-02-03 08:31:55 -06:00
influxdb-url.js feat(sample-data): add new wind sample dataset (#6440) 2025-10-06 12:08:35 -06:00
influxdb-version-detector.ts fix(version-detector): centralize Grafana links and DRY up host examples (#6693) 2026-01-26 18:42:09 -06:00
jquery-3.5.0.min.js groundwork for influxdb url select 2020-04-16 09:59:35 -06:00
keybindings.js Merge pull request #6079 from influxdata/chore-js-refactor-footer-scripts-modules 2025-06-09 14:40:37 -05:00
list-filters.js chore(js): Cleanup and add note about list-filters 2025-06-09 17:45:36 -05:00
main.js feat(api): Hugo-native API reference rendering 2026-03-15 22:17:33 -05:00
modals.js Initial Kapa.ai chat integration. 2025-02-03 08:31:55 -06:00
notifications.js Initial Kapa.ai chat integration. 2025-02-03 08:31:55 -06:00
page-context.ts Feature: Generate documentation in LLM-friendly Markdown (#6555) 2025-12-01 12:32:28 -06:00
page-feedback.js Initial Kapa.ai chat integration. 2025-02-03 08:31:55 -06:00
release-toc.js chore(js): Extract Hugo params imports to single-purpose modules, fix environment-specific Hugo configs, use Hugo environments instead of specifying the config file, configure source maps and ESM for development and testing 2025-06-09 16:46:26 -05:00
search-button.js Initial Kapa.ai chat integration. 2025-02-03 08:31:55 -06:00
sidebar-toggle.js chore(js): Extract Hugo params imports to single-purpose modules, fix environment-specific Hugo configs, use Hugo environments instead of specifying the config file, configure source maps and ESM for development and testing 2025-06-09 16:46:26 -05:00
tabbed-content.js Initial Kapa.ai chat integration. 2025-02-03 08:31:55 -06:00
theme-switch.js Merge pull request #6079 from influxdata/chore-js-refactor-footer-scripts-modules 2025-06-09 14:40:37 -05:00
theme.js hotfix: minor change to invalidate JS 2025-09-02 14:17:41 -05:00
v3-wayfinding.js chore(js): Extract Hugo params imports to single-purpose modules, fix environment-specific Hugo configs, use Hugo environments instead of specifying the config file, configure source maps and ESM for development and testing 2025-06-09 16:46:26 -05:00
version-selector.js chore(js): Format fixes 2025-06-09 14:42:38 -05:00