Skip to content

docs: canonicalize /tree/<file> GitHub links to /blob/ (consistency, low priority) #3302

@ihabadham

Description

@ihabadham

Summary

~16 documentation links use /tree/<ref>/<path-to-a-file> where the path resolves to a file, not a directory. GitHub's canonical URL form for a file is /blob/<ref>/<path>; /tree/ is for directories.

These links are not broken. GitHub 301-redirects /tree/<file>/blob/<file>, browsers render them fine, and the repo's .lychee.toml accepts 301, so the markdown link-check CI passes on them today. This is canonicalization / consistency polish, not a correctness fix — low priority.

PR #3232 incidentally canonicalized one instance (docs/oss/building-features/images.md) as an unprompted tidy. This issue tracks doing the rest consistently in one focused pass.

The one real care-point

A naive global s|/tree/|/blob/| is wrong. Some /tree/ links correctly point at directories and must be left as-is (a directory via /blob/ also misbehaves). Any cleanup must resolve each link's target as file-vs-directory and only rewrite the file ones.

File links to canonicalize (/tree//blob/)

  • README.mdCONTRIBUTING.md, LICENSE.md
  • docs/oss/api-reference/redux-store-api.mdpages_controller.rb, application.html.erb, controller.rb, helper.rb
  • docs/oss/api-reference/view-helpers-api.mdRouterApp.server.jsx, helper.rb
  • docs/oss/core-concepts/render-functions-and-railscontext.mdhelper.rb, react_on_rails.rb
  • docs/oss/core-concepts/how-react-on-rails-works.mdProcfile.dev
  • internal/contributor-info/linters.md.eslintrc
  • internal/contributor-info/releasing.mdCONTRIBUTING.md
  • internal/contributor-info/pull-requests.mdreact_on_rails.rb
  • internal/testimonials/README.mdPROJECTS.md, KUDOS.md
  • react_on_rails_pro/CONTRIBUTING.mdreact_on_rails.rb

Directory links to LEAVE untouched (correctly /tree/)

  • NEWS.md, docs/oss/introduction.md, docs/oss/getting-started/examples-and-references.mdreact_on_rails/spec/dummy
  • docs/oss/api-reference/view-helpers-api.md.../spec/dummy/app/views/react_router (note: this file has BOTH a directory /tree/ link to keep and a file /tree/ link to fix on nearby lines — check per-link, not per-file)
  • docs/oss/building-features/node-renderer/error-reporting-and-tracing.md.../integrations

Suggested approach

Per-link: resolve the path in the repo tree; if it's a file, rewrite /tree//blob/; if a directory, leave it. One PR, docs-only, no content changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions