From 56dbca37d0ffb89593fa70f525e98956eca51277 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sun, 25 Oct 2026 21:15:47 -0400 Subject: [PATCH] docs nav: move Administration above Devices in sidebar order --- internal/docs/navigation.go | 2 +- internal/docs/navigation_test.go | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/internal/docs/navigation.go b/internal/docs/navigation.go index 640f33ed..e10f711d 100644 --- a/internal/docs/navigation.go +++ b/internal/docs/navigation.go @@ -20,8 +20,8 @@ var sectionOrder = []struct { }{ {Title: "Getting Started", Icon: "book-open"}, {Title: "User Guide", Icon: "book"}, - {Title: "Devices", Icon: "device"}, {Title: "Administration", Icon: "shield"}, + {Title: "Devices", Icon: "device"}, {Title: "API Reference", Icon: "list"}, {Title: "Developer", Icon: "gear"}, {Title: "Operations", Icon: "database"}, diff --git a/internal/docs/navigation_test.go b/internal/docs/navigation_test.go index 09aacc96..5cddcac5 100644 --- a/internal/docs/navigation_test.go +++ b/internal/docs/navigation_test.go @@ -117,7 +117,7 @@ func TestBuildNavigation(t *testing.T) { t.Fatal("no sections built") } - wantOrder := []string{"Getting Started", "User Guide", "Devices", "Administration", "API Reference", "Developer", "Operations", "Contributing"} + wantOrder := []string{"Getting Started", "User Guide", "Administration", "Devices", "API Reference", "Developer", "Operations", "Contributing"} for i, want := range wantOrder { if nav.Sections[i].Title != want { t.Fatalf("section %d = %q, want %q", i, nav.Sections[i].Title, want) @@ -145,8 +145,9 @@ func TestBuildNavigation(t *testing.T) { t.Errorf("User Guide direct items = %+v, want User Guide pinned first", userGuide.Items) } - // Devices: own top-level section, expanded, no groups. - devices := nav.Sections[2] + // Devices: own top-level section, expanded, no groups. (Administration + // sits above it in the order; covered by the collapsed sweep below.) + devices := nav.Sections[3] if devices.Collapsed { t.Error("Devices section should be expanded: it contains the current page") } @@ -157,12 +158,15 @@ func TestBuildNavigation(t *testing.T) { t.Errorf("Devices items = %+v, want Kobo Setup + KOReader Setup", devices.Items) } - // Everything else starts collapsed. - for _, s := range nav.Sections[3:] { + // Everything else starts collapsed (Administration included). + for _, s := range nav.Sections[4:] { if !s.Collapsed { t.Errorf("section %q should be collapsed (current page is elsewhere)", s.Title) } } + if !nav.Sections[2].Collapsed || nav.Sections[2].Title != "Administration" { + t.Errorf("Administration section not collapsed at its position: %+v", nav.Sections[2]) + } // API Reference: subdirectory groups with the index page as Overview. api := nav.Sections[4]