refactor(api): Flatten API nav groups to single-tag items

Remove multi-tag groups (Administration, Concepts) and flatten to
single-tag groups for direct linking. Each API tag now renders as
a direct nav item instead of being nested under a parent group.

- Update api_nav_groups.yml to use single-tag groups only
- Delete Administration landing pages (not needed without nesting)
- Improve SCSS styling for API nav visibility and active states
worktree-2025-12-30T19-16-55
Jason Stirnaman 2025-12-09 16:14:20 -06:00
parent ed3a43566c
commit 918f7ffeef
5 changed files with 121 additions and 80 deletions

View File

@ -212,6 +212,21 @@
////////////////////////// API Navigation in Sidebar ///////////////////////////
////////////////////////////////////////////////////////////////////////////////
// API navigation wrapper - controls visibility
// Hidden by default, revealed via JS (localStorage) or on API pages
.api-nav-wrapper {
display: none; // Hidden by default
&.is-revealed {
display: block; // Revealed via JS
}
// Always show on API pages (server-rendered with .api-reference class)
.api-reference & {
display: block;
}
}
// API navigation section added to the existing Hugo sidebar
.api-nav {
margin-top: 2rem;
@ -245,14 +260,19 @@
border: none;
width: 100%;
text-align: left;
font-size: inherit;
font-size: 1.2rem; // Match sidebar .nav-category > a (19.2px)
font-family: inherit;
text-decoration: none; // For anchor version
&:hover {
color: $nav-category-hover;
}
// Collapse/expand indicator
&.is-active {
color: $nav-active;
}
// Collapse/expand indicator (for button headers)
&::before {
content: "";
display: inline-block;
@ -263,6 +283,7 @@
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
transition: transform 0.2s;
flex-shrink: 0;
}
&.is-open::before {
@ -270,6 +291,12 @@
}
}
// For anchor headers, keep the ::before arrow (same as button)
// No special handling needed - anchor headers look the same as button headers
a#{&}-header {
// Same styling as button, arrow works via ::before
}
&-items {
list-style: none;
padding-left: 2.5rem;
@ -328,23 +355,43 @@
&.delete { background-color: $r-curacao; color: #fff; }
}
// Operation items with method badges and paths
&.api-nav-operation {
a {
display: flex;
align-items: center;
gap: 0.4rem;
font-size: 1rem; // Match sidebar nav-item font size (18px base)
// Tag items that link to tag pages
&.api-nav-tag {
> a {
font-weight: $medium;
}
// Nested operations list under tag
.api-nav-operations {
list-style: none;
margin: 0.25rem 0 0.5rem;
padding-left: 0.75rem;
.api-nav-operation {
margin: 0.15rem 0;
a {
display: flex;
align-items: center;
gap: 0.4rem;
font-size: 0.85rem;
padding: 0.25rem 0;
}
}
}
}
// Operation items with method badges
&.api-nav-operation,
.api-nav-operation {
.api-method {
display: inline-block;
font-size: 0.6rem;
font-size: 0.55rem;
font-weight: $bold;
text-transform: uppercase;
padding: 0.15rem 0.3rem;
padding: 0.1rem 0.25rem;
border-radius: 3px;
min-width: 2.2rem;
min-width: 2rem;
text-align: center;
flex-shrink: 0;
@ -357,7 +404,7 @@
.api-path {
font-family: $code;
font-size: 0.9rem; // Slightly smaller than link text for hierarchy
font-size: 0.85rem;
word-break: break-all;
color: inherit;
}

View File

@ -255,6 +255,38 @@
}
}
}
// API operation items within Hugo menu
.api-operation {
a {
display: flex;
align-items: center;
gap: 0.4rem;
}
}
.api-method {
font-size: 0.6rem;
font-weight: 700;
padding: 0.15rem 0.35rem;
border-radius: 3px;
text-transform: uppercase;
flex-shrink: 0;
line-height: 1;
&--get { background: #61affe; color: white; }
&--post { background: #49cc90; color: white; }
&--put { background: #fca130; color: white; }
&--delete { background: #f93e3e; color: white; }
&--patch { background: #50e3c2; color: white; }
}
// Non-link group labels (for multi-tag groups)
.nav-group-label {
color: $nav-item;
font-weight: $medium;
display: inline-block;
}
}
}

View File

@ -1,26 +0,0 @@
---
title: Administration
description: Endpoints for managing databases, tables, and tokens.
type: api
layout: list
weight: 105
isConceptual: true
---
Use the Administration API to manage InfluxDB resources:
<div class="children-links">
### [Database](/influxdb3/core/api/database/)
Create, list, and delete databases.
### [Table](/influxdb3/core/api/table/)
Create and delete tables within databases.
### [Token](/influxdb3/core/api/token/)
Manage authentication tokens for API access.
</div>

View File

@ -1,26 +0,0 @@
---
title: Administration
description: Endpoints for managing databases, tables, and tokens.
type: api
layout: list
weight: 105
isConceptual: true
---
Use the Administration API to manage InfluxDB resources:
<div class="children-links">
### [Database](/influxdb3/enterprise/api/database/)
Create, list, and delete databases.
### [Table](/influxdb3/enterprise/api/table/)
Create and delete tables within databases.
### [Token](/influxdb3/enterprise/api/token/)
Manage authentication tokens for API access.
</div>

View File

@ -1,55 +1,69 @@
# API Navigation Groups
# Defines sidebar navigation structure for API reference documentation
# Tags are grouped by function/task for better UX
# 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
# url: (optional) URL path suffix for the group page (relative to api/)
groups:
- name: Concepts
- 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: 2
weight: 10
tags:
- Write data
- name: Query data
weight: 3
weight: 11
tags:
- Query data
- name: Cache data
weight: 4
weight: 12
tags:
- Cache data
- name: Administration
weight: 5
url: administration
- name: Database
weight: 20
tags:
- Database
- name: Table
weight: 21
tags:
- Table
- name: Token
weight: 22
tags:
- Token
- name: Processing Engine
weight: 6
- name: Processing engine
weight: 30
tags:
- Processing engine
- name: Server
weight: 7
- name: Server information
weight: 40
tags:
- Server information
- name: Compatibility
weight: 8
- name: Compatibility endpoints
weight: 50
tags:
- Compatibility endpoints