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") }} +
+ {{ end }} + {{/* SECTION INDEX - Show page content then children listing */}} {{ with .Content }}