diff --git a/data/api_nav_groups.yml b/data/api_nav_groups.yml
deleted file mode 100644
index 773e2cfde..000000000
--- a/data/api_nav_groups.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-# API Navigation Groups
-# Defines sidebar navigation structure for API reference documentation
-# Single-tag groups render as direct links; multi-tag groups create nested menus
-#
-# Group fields:
-# name: Display name in the navigation
-# weight: Sort order (lower = higher)
-# tags: List of tag names that belong to this group
-
-groups:
- - name: Quick start
- weight: 1
- tags:
- - Quick start
-
- - name: Authentication
- weight: 2
- tags:
- - Authentication
-
- - name: Headers and parameters
- weight: 3
- tags:
- - Headers and parameters
-
- - name: Write data
- weight: 10
- tags:
- - Write data
-
- - name: Query data
- weight: 11
- tags:
- - Query data
-
- - name: Cache data
- weight: 12
- tags:
- - Cache data
-
- - name: Database
- weight: 20
- tags:
- - Database
-
- - name: Table
- weight: 21
- tags:
- - Table
-
- - name: Auth token
- weight: 22
- tags:
- - Auth token
-
- - name: Processing engine
- weight: 30
- tags:
- - Processing engine
-
- - name: Server information
- weight: 40
- tags:
- - Server information
-
- - name: Compatibility endpoints
- weight: 50
- tags:
- - Compatibility endpoints
diff --git a/layouts/partials/sidebar/api-menu-items.html b/layouts/partials/sidebar/api-menu-items.html
index 204f5b924..120542452 100644
--- a/layouts/partials/sidebar/api-menu-items.html
+++ b/layouts/partials/sidebar/api-menu-items.html
@@ -4,13 +4,14 @@
Generates
elements matching Hugo's menu structure.
Used by nested-menu.html when rendering "InfluxDB HTTP API" menu item.
+ Sort order: conceptual tags (traitTags) first, then other tags alphabetically.
+
Parameters:
- page: Current page context
- url: URL of the API parent page (e.g., /influxdb3/core/api/)
Uses data from:
- data/article_data/influxdb/{product}/articles.yml
- - data/api_nav_groups.yml
*/}}
{{ $currentPage := .page }}
@@ -34,7 +35,6 @@
{{/* Get article data for this product */}}
{{ $siteData := .siteData }}
{{ $articles := slice }}
-{{/* Data path: data/article_data/influxdb/{dataKey}/articles.yml -> siteData.article_data.influxdb.{dataKey}.articles.articles */}}
{{ with $siteData.article_data }}
{{ with index . "influxdb" }}
{{ with index . $dataKey }}
@@ -47,9 +47,6 @@
{{ end }}
{{ end }}
-{{/* Get navigation groups configuration */}}
-{{ $navGroups := $siteData.api_nav_groups.groups }}
-
{{/* Check if articles use tag-based structure */}}
{{ $isTagBased := false }}
{{ if gt (len $articles) 0 }}
@@ -65,190 +62,90 @@
{{ end }}
{{ end }}
-{{ if and (gt (len $articles) 0) $navGroups $isTagBased }}
- {{/* Build a map of tag slug -> article for quick lookup */}}
- {{ $articlesByTag := dict }}
+{{ if and (gt (len $articles) 0) $isTagBased }}
+ {{/* Separate conceptual (traitTag) and non-conceptual articles */}}
+ {{ $conceptualArticles := slice }}
+ {{ $operationArticles := slice }}
+
{{ range $articles }}
{{ if and (reflect.IsMap .) (isset . "fields") }}
{{ $fields := index . "fields" }}
- {{ if and (reflect.IsMap $fields) (isset $fields "tag") }}
- {{ $tag := index $fields "tag" }}
- {{ $articlesByTag = merge $articlesByTag (dict $tag .) }}
- {{ end }}
- {{ end }}
- {{ end }}
-
- {{/* Render navigation groups */}}
- {{ range $groupIdx, $group := $navGroups }}
- {{ $groupTags := $group.tags }}
- {{ $groupHasArticles := false }}
-
- {{/* Check if any tags in this group have articles */}}
- {{ range $groupTags }}
- {{ if index $articlesByTag . }}
- {{ $groupHasArticles = true }}
- {{ end }}
- {{ end }}
-
- {{ if $groupHasArticles }}
- {{/* Count actual articles in this group */}}
- {{ $articlesInGroup := slice }}
- {{ range $groupTags }}
- {{ $article := index $articlesByTag . }}
- {{ if $article }}
- {{ $articlesInGroup = $articlesInGroup | append $article }}
- {{ end }}
- {{ end }}
- {{ $isSingleTag := eq (len $articlesInGroup) 1 }}
-
- {{/* Check if this group should be open (contains active page or active operation) */}}
- {{ $groupIsOpen := false }}
- {{ range $articlesInGroup }}
- {{ $path := index . "path" }}
- {{ $pageUrl := print "/" $product "/" $version "/" $path "/" }}
- {{ if eq $currentPage.RelPermalink $pageUrl }}
- {{ $groupIsOpen = true }}
- {{ end }}
- {{/* Also check if any operation pages in this group are active */}}
- {{ $fields := index . "fields" }}
- {{ if and (reflect.IsMap $fields) (isset $fields "operations") }}
- {{ range index $fields "operations" }}
- {{ $opPathSlug := .path | replaceRE "^/" "" }}
- {{ $opUrl := printf "/%s/%s/api/%s/%s/" $product $version $opPathSlug (lower .method) }}
- {{ if eq $currentPage.RelPermalink $opUrl }}
- {{ $groupIsOpen = true }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
-
- {{ if $isSingleTag }}
- {{/* Single tag group: direct link to tag page with operations as children */}}
- {{ $article := index $articlesInGroup 0 }}
- {{ $path := index $article "path" }}
- {{ $fields := index $article "fields" }}
- {{ $tagPageUrl := print "/" $product "/" $version "/" $path "/" | relURL }}
- {{ $isActive := eq $currentPage.RelPermalink (print "/" $product "/" $version "/" $path "/") }}
- {{ $operations := slice }}
- {{ if and (reflect.IsMap $fields) (isset $fields "operations") }}
- {{ $operations = index $fields "operations" }}
- {{ end }}
- {{/* Don't show operations for conceptual/traitTag pages (e.g., Authentication) */}}
+ {{ if reflect.IsMap $fields }}
{{ $isConceptual := false }}
- {{ if and (reflect.IsMap $fields) (isset $fields "isConceptual") }}
+ {{ if isset $fields "isConceptual" }}
{{ $isConceptual = index $fields "isConceptual" }}
{{ end }}
- {{ $hasOperations := and (gt (len $operations) 0) (not $isConceptual) }}
-
-
- {{ if $hasOperations }}{{ end }}
- {{ $group.name }}
- {{ if $hasOperations }}
-
- {{ end }}
-
-
- {{ else }}
- {{/* Multi-tag group: group label (or link if url defined) with tag pages as children */}}
- {{ $groupUrl := "" }}
- {{ $groupIsActive := false }}
- {{ with $group.url }}
- {{ $groupUrl = print "/" $product "/" $version "/api/" . "/" | relURL }}
- {{ $groupIsActive = eq $currentPage.RelPermalink (print "/" $product "/" $version "/api/" . "/") }}
+ {{ if $isConceptual }}
+ {{ $conceptualArticles = $conceptualArticles | append . }}
+ {{ else }}
+ {{ $operationArticles = $operationArticles | append . }}
{{ end }}
-
-
- {{ if $groupUrl }}
- {{ $group.name }}
- {{ else }}
- {{ $group.name }}
- {{ end }}
-
- {{ range $tagIdx, $tagName := $groupTags }}
- {{ $article := index $articlesByTag $tagName }}
- {{ if $article }}
- {{ $path := index $article "path" }}
- {{ $fields := index $article "fields" }}
- {{ $tagPageUrl := print "/" $product "/" $version "/" $path "/" | relURL }}
- {{ $isActive := eq $currentPage.RelPermalink (print "/" $product "/" $version "/" $path "/") }}
- {{ $operations := slice }}
- {{ if and (reflect.IsMap $fields) (isset $fields "operations") }}
- {{ $operations = index $fields "operations" }}
- {{ end }}
- {{ $menuName := $tagName }}
- {{ if and (reflect.IsMap $fields) (isset $fields "menuName") }}
- {{ $menuName = index $fields "menuName" }}
- {{ end }}
- {{/* Don't show operations for conceptual/traitTag pages (e.g., Authentication) */}}
- {{ $isConceptual := false }}
- {{ if and (reflect.IsMap $fields) (isset $fields "isConceptual") }}
- {{ $isConceptual = index $fields "isConceptual" }}
- {{ end }}
- {{ $hasOperations := and (gt (len $operations) 0) (not $isConceptual) }}
-
- -
- {{ if $hasOperations }}{{ end }}
- {{ $menuName }}
- {{/* Check if any operation in this tag is active */}}
- {{ $tagHasActiveOp := false }}
- {{ range $operations }}
- {{ $opPathSlug := .path | replaceRE "^/" "" }}
- {{ $opUrl := printf "/%s/%s/api/%s/%s/" $product $version $opPathSlug (lower .method) }}
- {{ if eq $currentPage.RelPermalink $opUrl }}
- {{ $tagHasActiveOp = true }}
- {{ end }}
- {{ end }}
- {{ if $hasOperations }}
-
- {{ end }}
-
- {{ end }}
- {{ end }}
-
-
{{ end }}
{{ end }}
{{ end }}
+
+ {{/* Sort each group alphabetically by tag name */}}
+ {{ $conceptualArticles = sort $conceptualArticles "fields.tag" }}
+ {{ $operationArticles = sort $operationArticles "fields.tag" }}
+
+ {{/* Combine: conceptual first, then operations */}}
+ {{ $sortedArticles := $conceptualArticles | append $operationArticles }}
+
+ {{/* Render each tag as a nav item */}}
+ {{ range $sortedArticles }}
+ {{ $path := index . "path" }}
+ {{ $fields := index . "fields" }}
+ {{ $tag := index $fields "tag" }}
+ {{ $tagPageUrl := print "/" $product "/" $version "/" $path "/" | relURL }}
+ {{ $isActive := eq $currentPage.RelPermalink (print "/" $product "/" $version "/" $path "/") }}
+
+ {{/* Get operations */}}
+ {{ $operations := slice }}
+ {{ if isset $fields "operations" }}
+ {{ $operations = index $fields "operations" }}
+ {{ end }}
+
+ {{/* Don't show operations for conceptual/traitTag pages */}}
+ {{ $isConceptual := false }}
+ {{ if isset $fields "isConceptual" }}
+ {{ $isConceptual = index $fields "isConceptual" }}
+ {{ end }}
+ {{ $hasOperations := and (gt (len $operations) 0) (not $isConceptual) }}
+
+ {{/* Check if any operation in this tag is active */}}
+ {{ $tagHasActiveOp := false }}
+ {{ range $operations }}
+ {{ $opPathSlug := .path | replaceRE "^/" "" }}
+ {{ $opUrl := printf "/%s/%s/api/%s/%s/" $product $version $opPathSlug (lower .method) }}
+ {{ if eq $currentPage.RelPermalink $opUrl }}
+ {{ $tagHasActiveOp = true }}
+ {{ end }}
+ {{ end }}
+
+
+ {{ if $hasOperations }}{{ end }}
+ {{ $tag }}
+ {{ if $hasOperations }}
+
+ {{ end }}
+
+ {{ end }}
{{ end }}