Skip to content

docs(readme): use an absolute URL for the logo - #62

Merged
plusky merged 1 commit into
mainfrom
docs/readme-absolute-logo-url
Aug 5, 2026
Merged

docs(readme): use an absolute URL for the logo#62
plusky merged 1 commit into
mainfrom
docs/readme-absolute-logo-url

Conversation

@plusky

@plusky plusky commented Aug 5, 2026

Copy link
Copy Markdown
Owner

The logo does not render on either crate's crates.io page
(bugwarden,
bugwarden-core), while it has
always rendered correctly on GitHub.

Cause

Not a missing file, and not HTML sanitization — crates.io keeps the <img>
tag. It resolves relative README paths against the directory the crate's
README lives in
. Both crates set readme = "README.md", and both of those
are symlinks to the root README.md, so the base becomes crates/bugwarden/
rather than the repository root. assets/logo.svg was therefore baked into
the published page as:

URL status
.../raw/HEAD/crates/bugwarden/assets/logo.svg — what crates.io generated 404
.../raw/HEAD/assets/logo.svg — where the file actually is 200

GitHub renders the same file with the repository root as its base, so the
relative path resolves there. One README, two different bases — no relative
path can satisfy both.

Fix

Name the source absolutely:

<img src="https://raw.githubusercontent.com/plusky/bugwarden/main/assets/logo.svg" ...>

Verified 200, and it renders under both renderers. main is pinned rather
than a tag so each page shows the current logo; a tag would freeze every
release page to the logo of its time.

This is the only relative asset reference in the README, and because both
crates share the file, the one change fixes both pages.

Scope limit

crates.io renders a README once at publish time and serves the frozen
HTML from static.crates.io. This cannot repair the already-published pages
for 0.1.0–0.3.0; it takes effect with the next published version.

Verification

cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings,
cargo test --workspace --all-targets --locked (357 passed, 0 failed) — all
green. The rendered-URL claims above were checked against the live
crates.io/api/v1/crates/bugwarden/0.3.0/readme output and by requesting
both GitHub URLs.

The logo does not render on either crate's crates.io page. The cause is
not a missing file or HTML sanitization: crates.io resolves relative
README paths against the directory the crate's README lives in, which is
crates/bugwarden/ (and crates/bugwarden-core/), because both crates
symlink the root README. So `assets/logo.svg` was baked into the rendered
page as

  https://github.com/plusky/bugwarden/raw/HEAD/crates/bugwarden/assets/logo.svg

which is a 404 -- the file is at assets/logo.svg in the repository root.
GitHub renders the same README with the repository root as its base, so
the relative path resolves there and the logo has always looked fine.

One file cannot satisfy both bases, so name the source absolutely. The
raw.githubusercontent URL returns 200 and renders on GitHub and crates.io
alike, and pinning main rather than a tag means each page shows the
current logo.

crates.io renders a README once at publish time and serves the frozen
HTML, so this cannot repair the pages for 0.1.0 through 0.3.0; it takes
effect with the next published version.
@plusky
plusky merged commit 0e210ff into main Aug 5, 2026
11 checks passed
@plusky
plusky deleted the docs/readme-absolute-logo-url branch August 5, 2026 17:21
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