Skip to content

Fix documentation 404s and generate static redirects - #587

Merged
floitsch merged 1 commit into
masterfrom
fix/docs-404-links
Sep 8, 2026
Merged

Fix documentation 404s and generate static redirects#587
floitsch merged 1 commit into
masterfrom
fix/docs-404-links

Conversation

@floitsch

@floitsch floitsch commented Sep 8, 2026

Copy link
Copy Markdown
Member

Google's 404 report exposed 19 internal links pointing to 17 missing documentation destinations. Correct those links across 13 pages using root-relative paths, including the MQTT setup links, cellular container links, PWM LED paths, and malformed tasks link.

Make static/redirects.yaml effective on the current GitHub Pages deployment by generating 28 standalone HTML redirect pages and registering both trailing-slash variants with Gatsby. Direct visits use an immediate meta refresh with a canonical URL; JavaScript preserves query strings and fragments. These are HTML redirects, not HTTP 301 responses. Retired Toit v1 pages without a clear replacement remain 404.

Add yarn check:links to the production build so missing internal destinations fail the build. The check uses Python 3 and inspects generated HTML without network access; external links and fragment identifiers are excluded. Redirect validation rejects existing-page collisions, missing targets, and redirect chains.

Validation:

  • Production HTML generation completed; yarn check:links passes for all 139 HTML files.
  • yarn lint passes.
  • yarn test --runInBand passes: 3 suites, 10 tests.
  • Verified all 28 redirect pages exist, both slash variants are registered, aliases are absent from the sitemap, and current content links directly to the replacement pages.
  • Link-checker fixtures cover valid pages/assets, external links, fragments, missing destinations, and a missing build.

@floitsch
floitsch merged commit 4e7506d into master Sep 8, 2026
5 checks passed
@floitsch
floitsch deleted the fix/docs-404-links branch September 8, 2026 09:18
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