docs nav: move Administration above Devices in sidebar order

This commit is contained in:
John O'Keefe committed 2026-10-25 21:15:47 -04:00
1 parent 27f42bf703
commit 56dbca37d0
2 files changed
+10 -6

No files matched your search

+1 -1
View File
@@ -20,8 +20,8 @@ var sectionOrder = []struct {
}{ }{
{Title: "Getting Started", Icon: "book-open"}, {Title: "Getting Started", Icon: "book-open"},
{Title: "User Guide", Icon: "book"}, {Title: "User Guide", Icon: "book"},
{Title: "Devices", Icon: "device"},
{Title: "Administration", Icon: "shield"}, {Title: "Administration", Icon: "shield"},
{Title: "Devices", Icon: "device"},
{Title: "API Reference", Icon: "list"}, {Title: "API Reference", Icon: "list"},
{Title: "Developer", Icon: "gear"}, {Title: "Developer", Icon: "gear"},
{Title: "Operations", Icon: "database"}, {Title: "Operations", Icon: "database"},
+9 -5
View File
@@ -117,7 +117,7 @@ func TestBuildNavigation(t *testing.T) {
t.Fatal("no sections built") 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 { for i, want := range wantOrder {
if nav.Sections[i].Title != want { if nav.Sections[i].Title != want {
t.Fatalf("section %d = %q, want %q", i, 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) t.Errorf("User Guide direct items = %+v, want User Guide pinned first", userGuide.Items)
} }
// Devices: own top-level section, expanded, no groups. // Devices: own top-level section, expanded, no groups. (Administration
devices := nav.Sections[2] // sits above it in the order; covered by the collapsed sweep below.)
devices := nav.Sections[3]
if devices.Collapsed { if devices.Collapsed {
t.Error("Devices section should be expanded: it contains the current page") 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) t.Errorf("Devices items = %+v, want Kobo Setup + KOReader Setup", devices.Items)
} }
// Everything else starts collapsed. // Everything else starts collapsed (Administration included).
for _, s := range nav.Sections[3:] { for _, s := range nav.Sections[4:] {
if !s.Collapsed { if !s.Collapsed {
t.Errorf("section %q should be collapsed (current page is elsewhere)", s.Title) 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 Reference: subdirectory groups with the index page as Overview.
api := nav.Sections[4] api := nav.Sections[4]