hotfix(docs): README-page 404s, link previews, edit-this-page button (0.20.7) - #419
Merged
Conversation
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>
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>
Contributor
Test Metrics —
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdtoexclude_docsto keep it off the site.exclude_docspatterns are gitignore-style, so the unanchored name matches at every depth — silently excluding every README thesame-dirplugin serves as a docs page.Fix: anchor the pattern as
/README.mdso 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) — baremike set-defaultredirect stub titled "Redirecting"/0.20/(version root) — bare mkdocs-redirects stub (index.md → docs/index.md) titled "Redirecting..."og:*/description tags (Material only emits them via itssocialplugin, which we don't run)Fix, one per layer:
mike set-default -Twith a custom template (.github/workflows/templates/root-redirect.html) — real title/description + OG/Twitter Card tags, same instant redirect via{{href}}docs/hooks/social_meta_redirect_stub.pyretitles the generated stub and injects the same meta blockdocs/overrides/main.html(blockextrahead;home.htmlalready extendsmain.html) adds per-pageog:title/og:description/og:image+ Twitter Card tags, and mkdocs.yml gainssite_descriptionog:imageis 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.editfeature +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. Sincedocs_diris the repo root,edit_uriis just the branch prefix — it defaults toedit/main/and the develop docs deploy overrides it toedit/develop/via aDOCS_EDIT_URIenv var (mkdocs!ENV). The landing page keeps no edit button by design (itshome.htmlhero template has no content header).Per the hotfix rule (#418): VERSION
0.20.6→0.20.7with a dated release-notes section covering all three changes.Verification
pathspec.gitignorecheck:/README.mdmatches only the root README; nested ones no longer match.edit/main/tests/README.md, regular pages to their own.mdsource.mkdocs build:tests/,osmo/,ci-cd-orchestrator/, and package README pages all generated; the hook loggedinjected social meta into version-root redirect stub; home-page hero markup intact; per-pageog:titlecorrect (e.g. "System Test Suite - AirStack").autoescape=True,href='0.20/') exactly as mike 2.2'sset-defaultdoes — redirect and meta both correct.Merging triggers
deploy_docs_from_main.yaml, republishing the0.20slug 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