Skip to content

hotfix(docs): README-page 404s, link previews, edit-this-page button (0.20.7) - #419

Merged
andrewjong merged 3 commits into
mainfrom
hotfix-docs-readme-exclude
Aug 30, 2026
Merged

hotfix(docs): README-page 404s, link previews, edit-this-page button (0.20.7)#419
andrewjong merged 3 commits into
mainfrom
hotfix-docs-readme-exclude

Conversation

@andrewjong

@andrewjong andrewjong commented Aug 30, 2026

Copy link
Copy Markdown
Member

Three docs-site changes in one 0.20.7 hotfix.

1. Every README-sourced page 404s

On the published 0.20 docs, https://docs.theairlab.org/0.20/tests/ and https://docs.theairlab.org/0.20/osmo/ (Reference → CI & Testing / OSMO Lab Admin Guide) return 404 — and so does every other page sourced from a file named README.md, including all autonomy package reference pages (e.g. /0.20/robot/ros_ws/src/local/planners/droan_local_planner/). Pages from non-README sources (e.g. tests/ci-cd-orchestrator.md) work fine.

Cause: Release 0.20.0 (#409) added the repo-root README.md to exclude_docs to keep it off the site. exclude_docs patterns are gitignore-style, so the unanchored name matches at every depth — silently excluding every README the same-dir plugin serves as a docs page.

Fix: anchor the pattern as /README.md so only the repo root is excluded, with a comment explaining the gitignore semantics.

2. Shared links preview as "Redirecting" (Slack/WhatsApp/iMessage)

Preview scrapers fetch raw HTML — no JS, no meta-refresh following — and every layer of the site lacked metadata:

  • / (root) — bare mike set-default redirect stub titled "Redirecting"
  • /0.20/ (version root) — bare mkdocs-redirects stub (index.md → docs/index.md) titled "Redirecting..."
  • content pages — real titles but no og:*/description tags (Material only emits them via its social plugin, which we don't run)

Fix, one per layer:

  • root: mike set-default -T with a custom template (.github/workflows/templates/root-redirect.html) — real title/description + OG/Twitter Card tags, same instant redirect via {{href}}
  • version root: new post-build hook docs/hooks/social_meta_redirect_stub.py retitles the generated stub and injects the same meta block
  • content pages: new theme override docs/overrides/main.html (block extrahead; home.html already extends main.html) adds per-page og:title/og:description/og:image + Twitter Card tags, and mkdocs.yml gains site_description

og:image is the 1600×900 splash poster served via the moving /main/ alias (mike copies real asset files into alias dirs — verified HTTP 200), so the absolute URL survives releases.

3. "Edit this page" button on every docs page

Enables Material's content.action.edit feature + edit_uri: each page shows a pencil icon linking to GitHub's editor for that page's source file. Contributors without write access automatically get GitHub's fork-and-propose flow. Since docs_dir is the repo root, edit_uri is just the branch prefix — it defaults to edit/main/ and the develop docs deploy overrides it to edit/develop/ via a DOCS_EDIT_URI env var (mkdocs !ENV). The landing page keeps no edit button by design (its home.html hero template has no content header).

Per the hotfix rule (#418): VERSION 0.20.60.20.7 with a dated release-notes section covering all three changes.

Verification

  • pathspec.gitignore check: /README.md matches only the root README; nested ones no longer match.
  • Edit links verified in the local build: README pages link to e.g. edit/main/tests/README.md, regular pages to their own .md source.
  • Local mkdocs build: tests/, osmo/, ci-cd-orchestrator/, and package README pages all generated; the hook logged injected social meta into version-root redirect stub; home-page hero markup intact; per-page og:title correct (e.g. "System Test Suite - AirStack").
  • The mike template rendered with Jinja2 (autoescape=True, href='0.20/') exactly as mike 2.2's set-default does — redirect and meta both correct.

Merging triggers deploy_docs_from_main.yaml, republishing the 0.20 slug and root in place. Note: previews for already-shared links stay stale until each app's link cache expires (Slack can be flushed per-URL via their debugger).

🤖 Generated with Claude Code

andrewjong and others added 2 commits August 30, 2026 01:06
The exclude_docs entry meant to hide the GitHub-facing repo README used
the bare pattern 'README.md'. exclude_docs patterns are gitignore-style,
so an unanchored name matches at every depth — silently excluding every
README.md the same-dir plugin serves as a docs page. On the published
0.20 site this 404'd the System Test Suite (/tests/), the OSMO Lab
Admin Guide (/osmo/), and all autonomy package reference pages, while
non-README sources (e.g. tests/ci-cd-orchestrator.md) kept working.

Anchor the pattern as '/README.md' so only the repo root is excluded.
Verified with a local mkdocs build: tests/, osmo/, and package README
pages are generated again and the root URL still serves the redirect.

VERSION 0.20.6 -> 0.20.7 with a dated release-notes section per the
hotfix rule from #418.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sharing docs.theairlab.org in Slack/WhatsApp/iMessage previewed as
"Redirecting": preview scrapers fetch raw HTML without running JS or
following meta-refresh, and every layer of the site lacked metadata —
the root redirect stub (mike set-default), the version-root stub
(/0.20/, from the mkdocs-redirects index.md map), and the content
pages themselves (Material emits og: tags only via its social plugin).

Three fixes, one per layer:
- root: deploy the redirect via `mike set-default -T` with a custom
  template (.github/workflows/templates/root-redirect.html) carrying a
  real title, description, and OG/Twitter Card tags ({{href}} keeps the
  instant redirect)
- version root: a post-build hook
  (docs/hooks/social_meta_redirect_stub.py) retitles the generated
  redirect stub and injects the same meta block
- content pages: docs/overrides/main.html adds per-page og:title /
  og:description / og:image + twitter tags in block extrahead
  (home.html already extends main.html, so the whole site inherits),
  and mkdocs.yml gains site_description

og:image is the 1600x900 splash poster via the moving /main/ alias,
which serves real asset files, so the absolute URL survives releases.

Verified with a local mkdocs build (stub injected, home hero intact,
per-page titles on README pages) and by rendering the mike template
with Jinja2 exactly as mike 2.2 does.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andrewjong andrewjong changed the title hotfix(docs): anchor exclude_docs README pattern to repo root (0.20.7) hotfix(docs): fix README-page 404s + link-preview metadata (0.20.7) Aug 30, 2026
Enable Material's content.action.edit feature with edit_uri so each
page links to GitHub's editor for its source file; contributors
without write access get GitHub's fork-and-propose flow automatically.

docs_dir is the repo root, so page paths are already repo-relative and
edit_uri is just the branch prefix. It defaults to edit/main/ and is
overridable via the DOCS_EDIT_URI env var (mkdocs !ENV tag), which the
develop docs deploy sets to edit/develop/ so unstable docs edit the
branch they were built from.

The landing page keeps no edit button by design: its home.html hero
template has no content header. Verified with a local build — README
pages link to e.g. edit/main/tests/README.md, regular pages to their
own .md source.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andrewjong andrewjong changed the title hotfix(docs): fix README-page 404s + link-preview metadata (0.20.7) hotfix(docs): README-page 404s, link previews, edit-this-page button (0.20.7) Aug 30, 2026
@andrewjong
andrewjong merged commit 8aed8fc into main Aug 30, 2026
2 of 4 checks passed
@andrewjong
andrewjong deleted the hotfix-docs-readme-exclude branch August 30, 2026 05:26
@github-actions

Copy link
Copy Markdown
Contributor

Test Metrics — 169e388cdc65fabfc46afc92ab246886d670da9e

This was a unit/build-only run. Simulation regression comparison does not apply.

system.test_build_packages

Pass rates

Test Pass Fail Skip Rate
test_colcon_build_gcs 1 0 0 100%
test_colcon_build_ms_airsim 1 0 0 100%
test_colcon_build_robot 1 0 0 100%
test_colcon_test_robot 1 0 0 100%

Metrics

Test Metric Value
test_colcon_build_robot duration_s 91.3s
test_colcon_test_robot duration_s 41s
test_colcon_build_gcs duration_s 67.15s
test_colcon_build_ms_airsim duration_s 13.61s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant