Skip to content

Codex URL structure and category navigation#2624

Merged
reakaleek merged 2 commits intomainfrom
feature/codex-urls
Feb 4, 2026
Merged

Codex URL structure and category navigation#2624
reakaleek merged 2 commits intomainfrom
feature/codex-urls

Conversation

@reakaleek
Copy link
Copy Markdown
Member

@reakaleek reakaleek commented Feb 4, 2026

Summary

Adds a new URL structure and navigation model for the documentation codex:

  • Stable repository URLs (/r/{repo-name}) that do not change when category membership changes
  • Category landing pages (/g/{category}) that group related documentation sets
  • Shared navigation for repositories in the same category (same sidebar on group landing and all member repo pages)
  • Isolated navigation for ungrouped repositories (sidebar shows only that repo’s tree)
  • Optional site prefix so the codex can be hosted at the domain root (e.g. codex.elastic.dev)

Motivation

Previously, repository URLs could be tied to category structure, so changing a repo’s category could break links. We also lacked a way to show a single navigation tree for a set of related docs.

This change separates URL shape from organisation:

  • URLs are stable and predictable: /r/apm-agent always targets the APM Agent docs
  • Categories are for navigation only: any page in the “observability” category shows the same sidebar (group landing + all observability repos)
  • Ungrouped repos use their own navigation root so the sidebar stays focused on that repo

Implementation

URL patterns

Pattern Purpose Example
/r/{repo-name} Stable repo URL /r/apm-agent, /r/uptime-docs
/g/{category} Category landing /g/observability, /g/tooling
/ or /{site_prefix} Codex landing /, /internal-docs

Architecture

  • GroupNavigation – New navigation root type per category. It is the NavigationRoot for all repos in that category, holds the category landing page and member repos as top-level items, and ensures the same sidebar on the category landing and every member repo page.
  • Ungrouped repos – Their DocumentationSetNavigation is their own NavigationRoot, so the sidebar shows only that repo’s tree.
  • IsolatedBuildNavigationHtmlWriter – Uses SelectNavigationRoot() so when a different root is requested (e.g. GroupNavigation), that root is used for rendering instead of the site root. TopLevelItems come from the selected navigation, so the sidebar reflects the correct tree.

Key changes

New

  • GroupNavigation.cs – Category navigation root and related types (GroupIndexLeaf, GroupLinkLeaf, etc.)
  • GroupLandingView.cshtml – Razor view for category landing pages
  • GroupLandingViewModel.cs – View model for category landing pages

Navigation behaviour

Repo type Sidebar shows NavigationRoot
In a category Category landing + all category members GroupNavigation
No category Only that repo’s tree DocumentationSetNavigation

Configuration

documentation_sets:
  # Ungrouped – sidebar shows only this repo
  - name: docs-eng-team
    repo_name: ci-guide
    display_name: "CI Developer Guide"

  # In a category – shared sidebar with other observability repos
  - name: docs-eng-team
    category: observability
    repo_name: apm-agent-docs
    display_name: "APM Agent"

# Optional – omit or set to "/" for root hosting
site_prefix: /

Manual verification

  • Build codex with mixed grouped/ungrouped repos
    • dotnet run --project src/tooling/docs-builder -- codex clone config/codex.example.yml
    • dotnet run --project src/tooling/docs-builder -- codex build config/codex.example.yml
    • dotnet run --project src/tooling/docs-builder -- codex serve
  • Confirm /r/{repo} works for all repos regardless of category
  • Confirm /g/{category} shows only that category’s members
  • Confirm grouped repo pages show shared category sidebar
  • Confirm ungrouped repo pages show only that repo’s sidebar
  • Confirm display_name from config appears in the sidebar
  • Confirm codex works with no site_prefix and with a prefix
  • Confirm HTMX attributes on category landing work as expected

Recording

cursorful-video-1770203225778.mp4

Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Dismissed
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Fixed
Comment thread tests/Navigation.Tests/Codex/GroupNavigationTests.cs Dismissed
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Dismissed
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Fixed
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Fixed
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Fixed
…null'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Dismissed
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Dismissed
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Dismissed
Comment thread tests/Navigation.Tests/Codex/CodexNavigationRenderingTests.cs Dismissed
@elastic elastic deleted a comment from Copilot AI Feb 4, 2026
@reakaleek reakaleek closed this Feb 4, 2026
@reakaleek reakaleek reopened this Feb 4, 2026
@reakaleek reakaleek marked this pull request as ready for review February 4, 2026 12:02
@reakaleek reakaleek requested review from a team as code owners February 4, 2026 12:02
@reakaleek reakaleek requested a review from Mpdreamz February 4, 2026 12:02
@reakaleek reakaleek merged commit c690629 into main Feb 4, 2026
51 of 56 checks passed
@reakaleek reakaleek deleted the feature/codex-urls branch February 4, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants