glanceapp/glance · error

page : desktop-navigation-width can only be either wide or…

Error message

page %d: desktop-navigation-width can only be either wide or slim

What it means

Same constraint as page width, applied to the optional desktop-navigation-width setting: when present it must be wide, slim, or default. The message text says 'wide or slim' but default and empty are also accepted by the code.

Solutions

  1. Use wide, slim, or default for desktop-navigation-width, or omit it
  2. Verify lowercase spelling
  3. If you wanted a different size, check whether your glance version supports it before upgrading assumptions

Example fix

# before
- name: Home
  desktop-navigation-width: medium
# after
- name: Home
  desktop-navigation-width: slim
Defensive patterns

Strategy: type-guard

Validate before calling

var navWidths = map[string]bool{"wide": true, "slim": true, "default": true, "": true}
for i, p := range cfg.Pages {
    if !navWidths[p.DesktopNavigationWidth] {
        return fmt.Errorf("page %d bad desktop-navigation-width %q", i+1, p.DesktopNavigationWidth)
    }
}

Type guard

func isValidNavWidth(w string) bool {
    return w == "wide" || w == "slim" || w == "default" || w == ""
}

Prevention

When it happens

Trigger: Setting pages[N].desktop-navigation-width to any string besides wide/slim/default — e.g. 'medium', 'collapsed', or wrong capitalization.

Common situations: Trying to make the sidebar narrower with an invented value; typos; configs ported from themes/forks that support extra widths.

Related errors


AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15). Data as JSON: /api/errors/91aa7531447ea4d6. Report an issue: GitHub.

Appendix: source

Thrown at internal/glance/config.go:499

		if _, err := os.Stat(config.Server.AssetsPath); os.IsNotExist(err) {
			return fmt.Errorf("assets directory does not exist: %s", config.Server.AssetsPath)
		}
	}

	for i := range config.Pages {
		page := &config.Pages[i]

		if page.Title == "" {
			return fmt.Errorf("page %d has no name", i+1)
		}

		if page.Width != "" && (page.Width != "wide" && page.Width != "slim" && page.Width != "default") {
			return fmt.Errorf("page %d: width can only be either wide or slim", i+1)
		}

		if page.DesktopNavigationWidth != "" {
			if page.DesktopNavigationWidth != "wide" && page.DesktopNavigationWidth != "slim" && page.DesktopNavigationWidth != "default" {
				return fmt.Errorf("page %d: desktop-navigation-width can only be either wide or slim", i+1)
			}
		}

		if len(page.Columns) == 0 {
			return fmt.Errorf("page %d has no columns", i+1)
		}

		if page.Width == "slim" {
			if len(page.Columns) > 2 {
				return fmt.Errorf("page %d is slim and cannot have more than 2 columns", i+1)
			}
		} else {
			if len(page.Columns) > 3 {
				return fmt.Errorf("page %d has more than 3 columns", i+1)
			}
		}

		columnSizesCount := make(map[string]int)

View on GitHub (pinned to 91324e8de7)