diff --git a/layouts/_default/api.html b/layouts/_default/api.html index 4969a1b1c..39e10cb2c 100644 --- a/layouts/_default/api.html +++ b/layouts/_default/api.html @@ -3,7 +3,17 @@ pages. Delegates to appropriate templates based on page type: - Section pages: Use section.html logic (children listing) - Pages with staticFilePath: Use RapiDoc renderer Note: This template exists as a catch-all but specific templates (api/section.html, api/list.html, api/single.html) should be -preferred. */}} {{/* Section pages without staticFilePath should render content +preferred. */}} + +{{/* Extract product and version from URL path for download buttons */}} +{{/* Example: /influxdb3/clustered/api/ → ["", "influxdb3", "clustered", "api", ""] */}} +{{ $pathParts := split .RelPermalink "/" }} +{{ $version := "" }} +{{ if ge (len $pathParts) 3 }} + {{ $version = index $pathParts 2 }} +{{ end }} + +{{/* Section pages without staticFilePath should render content directly, not use RapiDoc */}} {{ if and .IsSection (not .Params.staticFilePath) }} {{ partial "header.html" . }} {{ partial "topnav.html" . }} @@ -20,6 +30,26 @@ directly, not use RapiDoc */}} {{ if and .IsSection (not .Params.staticFilePath) {{ end }} + {{/* Dual download buttons for Clustered and Cloud Dedicated */}} + {{ if or (eq $version "clustered") (eq $version "cloud-dedicated") }} +
+ + + Download Data API Spec + + + + Download Management API Spec + +
+ {{ end }} + {{/* SECTION INDEX - Show page content then children listing */}} {{ with .Content }}
{{ . }}
@@ -58,3 +88,25 @@ partial "topnav.html" . }} {{ partial "footer.html" . }} {{ end }} + + diff --git a/layouts/api/list.html b/layouts/api/list.html index 5ba786615..f36746f6b 100644 --- a/layouts/api/list.html +++ b/layouts/api/list.html @@ -3,10 +3,15 @@ param) - shows list of tag pages from article data 2. Tag pages (has 'tag' param) - shows RapiDoc with all operations for the tag For conceptual pages (isConceptual: true), shows content without operations. */}} -{{/* Extract product and version from URL for download buttons */}} -{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }} -{{ $product := index $productPathData 0 }} -{{ $version := index $productPathData 1 }} +{{/* Extract product and version from URL path for download buttons */}} +{{/* Example: /influxdb3/clustered/api/ → ["", "influxdb3", "clustered", "api", ""] */}} +{{ $pathParts := split .RelPermalink "/" }} +{{ $product := "" }} +{{ $version := "" }} +{{ if ge (len $pathParts) 3 }} + {{ $product = index $pathParts 1 }} + {{ $version = index $pathParts 2 }} +{{ end }} {{ partial "header.html" . }} {{ partial "topnav.html" . }} diff --git a/layouts/api/section.html b/layouts/api/section.html index d16a59ead..2fbcb70b0 100644 --- a/layouts/api/section.html +++ b/layouts/api/section.html @@ -1,7 +1,17 @@ {{/* API Documentation Section Layout Used for API section index pages (e.g., /influxdb3/core/api/). Shows page content with children listing instead of RapiDoc renderer. For tag pages (with 'tag' param), Hugo uses list.html instead. -*/}} {{ partial "header.html" . }} {{ partial "topnav.html" . }} +*/}} + +{{/* Extract product and version from URL path for download buttons */}} +{{/* Example: /influxdb3/clustered/api/ → ["", "influxdb3", "clustered", "api", ""] */}} +{{ $pathParts := split .RelPermalink "/" }} +{{ $version := "" }} +{{ if ge (len $pathParts) 3 }} + {{ $version = index $pathParts 2 }} +{{ end }} + +{{ partial "header.html" . }} {{ partial "topnav.html" . }}
{{ partial "sidebar.html" . }} @@ -16,6 +26,26 @@ RapiDoc renderer. For tag pages (with 'tag' param), Hugo uses list.html instead. {{ end }} + {{/* Dual download buttons for Clustered and Cloud Dedicated */}} + {{ if or (eq $version "clustered") (eq $version "cloud-dedicated") }} +
+ + + Download Data API Spec + + + + Download Management API Spec + +
+ {{ end }} + {{/* SECTION INDEX - Show intro content then tag-based children */}} {{ with .Content }}
{{ . }}
@@ -32,3 +62,25 @@ RapiDoc renderer. For tag pages (with 'tag' param), Hugo uses list.html instead.
{{ partial "footer.html" . }} + +