Skip to content

Commit 87929ad

Browse files
authored
docs: keep page URLs aligned with file paths (ai-openshell#3713)
* docs: align page file names and nav labels with published URLs Signed-off-by: Johnny Greco <jogreco@nvidia.com> * docs: redirect moved dev pages and fix agent guide redirects Signed-off-by: Johnny Greco <jogreco@nvidia.com> * ci(docs): check that page URLs match their file paths Signed-off-by: Johnny Greco <jogreco@nvidia.com> * fix(docs): align navigation checks with repo conventions Signed-off-by: Johnny Greco <jogreco@nvidia.com> * docs: omit historical redirect aliases Signed-off-by: Johnny Greco <jogreco@nvidia.com> * fix(docs): preserve published overview and TypeScript URLs Signed-off-by: Johnny Greco <jogreco@nvidia.com> * fix(docs): redirect unversioned overview and TypeScript URLs Signed-off-by: Johnny Greco <jogreco@nvidia.com> --------- Signed-off-by: Johnny Greco <jogreco@nvidia.com>
1 parent 8934b74 commit 87929ad

16 files changed

Lines changed: 524 additions & 11 deletions

File tree

‎.agents/skills/update-docs/SKILL.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Write the doc update following the rules in `docs/CONTRIBUTING.mdx`. Key reminde
108108
- **Use `sidebar-title` for short nav labels**. For explicit navigation entries, keep relative `slug` values in `docs/index.yml` instead of page frontmatter.
109109
- **Keep explicit `page:` entries in `docs/index.yml`**. Fern still requires them. If the page defines `sidebar-title`, set `page:` to that value. Otherwise set `page:` to the page frontmatter `title`.
110110
- **Use `skip-slug: true` in `docs/index.yml`** when a child page should live at the parent section path.
111+
- **Keep each page URL equal to its file path** under `docs/`. Rename the file when you rename a page, add a `fern/docs.yml` redirect for the old URL, and set a relative `slug:` when the nav label does not produce the file name. `mise run docs` runs `docs:nav`, which fails otherwise.
111112
- **Use `keywords` as a comma-separated string**.
112113
- **Do not add a duplicate H1**. Fern renders the page title from frontmatter.
113114
- **Always write NVIDIA in all caps.** Wrong: Nvidia, nvidia.

‎.github/workflows/branch-docs.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- "fern/**"
88
- "mise.toml"
99
- "tasks/docs.toml"
10+
- "tasks/test.toml"
11+
- "tasks/scripts/check_docs_nav.py"
12+
- "tasks/scripts/check_docs_nav_test.py"
1013
- ".github/workflows/branch-docs.yml"
1114
- ".github/workflows/release-tag.yml"
1215

@@ -47,6 +50,18 @@ jobs:
4750
working-directory: ./fern
4851
run: fern check
4952

53+
- name: Install uv
54+
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
55+
with:
56+
version: "0.10.12"
57+
python-version: "3.13"
58+
59+
- name: Test docs navigation check
60+
run: uv run --no-project --with pytest --with pytest-asyncio --with pyyaml pytest tasks/scripts/check_docs_nav_test.py
61+
62+
- name: Check docs navigation matches file paths
63+
run: uv run tasks/scripts/check_docs_nav.py
64+
5065
- name: Generate preview URL
5166
if: ${{ steps.fern-preview.outputs.enabled == 'true' }}
5267
id: generate-docs

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ field design, and schema-evolution rules.
487487

488488
## Documentation
489489

490-
If your change affects user-facing behavior (new flags, changed defaults, new features, bug fixes that contradict existing docs), update the relevant pages under `docs/` in the same PR and adjust `docs/index.yml` if navigation changes. For explicit navigation entries, keep `page:` aligned with `sidebar-title` when present and put relative `slug:` values in `docs/index.yml`. Reserve frontmatter `slug` for folder-discovered pages or absolute URL overrides.
490+
If your change affects user-facing behavior (new flags, changed defaults, new features, bug fixes that contradict existing docs), update the relevant pages under `docs/` in the same PR and adjust `docs/index.yml` if navigation changes. For explicit navigation entries, keep `page:` aligned with `sidebar-title` when present and put relative `slug:` values in `docs/index.yml`. Reserve frontmatter `slug` for folder-discovered pages or absolute URL overrides. Keep every page URL equal to its file path under `docs/`; `mise run docs` checks this with `docs:nav`.
491491

492492
To ensure your doc changes follow NVIDIA documentation style, use the `update-docs-from-commits` skill.
493493
It scans commits, identifies doc pages that need updates, and drafts content that follows the style guide in `docs/CONTRIBUTING.mdx`.

‎architecture/build.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,10 @@ See `CI.md` for the contributor workflow, labels, and maintainer merge-queue wor
584584
Published docs live in `docs/`. Navigation lives in `docs/index.yml`. Fern site
585585
configuration, components, theme assets, and publish settings live in `fern/`.
586586

587-
Use `mise run docs` for strict validation and `mise run docs:serve` for local
588-
preview. PR previews are produced by `.github/workflows/branch-docs.yml` when
587+
Use `mise run docs` for Fern validation and navigation-to-file-path consistency,
588+
and `mise run docs:serve` for local preview. The docs PR workflow also runs the
589+
navigation check's unit tests (`mise run test:docs-nav`).
590+
PR previews are produced by `.github/workflows/branch-docs.yml` when
589591
Fern credentials are available. Production docs publish from the release tag
590592
workflow. Redirect rules follow the mutable snapshot that owns their source URL
591593
(or destination for unversioned aliases). Syncing replaces that channel's rules,

‎docs/CONTRIBUTING.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ keywords: "Generative AI, Cybersecurity, AI Agents, Sandboxing"
8989

9090
For explicit entries in `docs/index.yml`, keep `page:`. Fern still requires it. If the page defines `sidebar-title`, set `page:` to that value. Otherwise set `page:` to the frontmatter `title`.
9191

92+
Keep every page URL equal to its file path under `docs/`, without `.mdx`. Fern builds URLs from nav labels and slugs, not from file paths, so rename the file when you rename a page, and add a redirect in `fern/docs.yml` for the old URL. When a nav label does not produce the file name, for example `TypeScript`, which Fern turns into `type-script`, set a relative `slug:` on the entry in `docs/index.yml`. `mise run docs` runs `mise run docs:nav`, which fails when a page URL differs from its file path, when a nav label differs from the page's sidebar name, when a page is missing from the navigation, or when a redirect points to a page that does not exist.
93+
9294
### Page Structure
9395

9496
1. Frontmatter `title` and `description`, plus any relevant page metadata.
File renamed without changes.

‎docs/how-it-works/gateways/authentication.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
title: "Gateway Authentication"
5+
sidebar-title: "Authentication"
56
description: "Gateway resolution, authentication modes, connection flow, OIDC support, and credential file layout."
67
keywords: "Generative AI, Cybersecurity, Gateway, Authentication, mTLS, OIDC, OpenID Connect, Edge Authentication, Reference"
78
position: 1

‎docs/index.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ navigation:
99
- section: "About NVIDIA OpenShell"
1010
slug: about
1111
contents:
12-
- page: "Why OpenShell"
12+
- page: "Overview"
1313
path: about/overview.mdx
1414
- page: "Architecture"
1515
path: about/architecture.mdx
1616
- page: "Installation"
1717
path: about/installation.mdx
1818
- page: "Run Your First Agent"
19-
path: about/run-an-agent.mdx
19+
path: about/run-your-first-agent.mdx
2020
- page: "Support Matrix"
2121
path: about/support-matrix.mdx
2222
- section: "How It Works"
@@ -102,14 +102,15 @@ navigation:
102102
title: "Kubernetes"
103103
- section: "Tutorials"
104104
slug: tutorials
105+
path: tutorials/index.mdx
105106
contents:
106107
- page: "Run Pi with OpenRouter"
107108
path: tutorials/run-pi-with-openrouter.mdx
108109
slug: run-pi-with-openrouter
109110
- page: "First Network Policy"
110111
path: tutorials/first-network-policy.mdx
111112
- page: "GitHub Push Access"
112-
path: tutorials/github-sandbox.mdx
113+
path: tutorials/github-push-access.mdx
113114
- page: "Microsoft Graph Provider Refresh"
114115
path: tutorials/microsoft-graph-provider-refresh.mdx
115116
- section: "SDK Reference"
@@ -123,6 +124,7 @@ navigation:
123124
path: sdk/python.mdx
124125
- page: "TypeScript"
125126
path: sdk/typescript.mdx
127+
slug: typescript
126128
- page: "API Errors"
127129
path: sdk/api-errors.mdx
128130
- page: "Protobuf Time Types"

‎docs/sdk/protobuf-time-types.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Protobuf time types
3+
sidebar-title: "Protobuf Time Types"
34
description: Timestamp and duration representation in the OpenShell API
45
---
56

0 commit comments

Comments
 (0)