Repository navigation
Standardize the sponsor images - #647
Merged
Merged
Conversation
The footer, which is on every page, showed a 15950 x 8378 PNG in a 192 px slot. Browsers decode an image at full size whatever size it is shown at: about 535 MB of pixels and close to two seconds in Firefox, on every page load, while Chromium refused to decode it at all. That was the lag before the sponsor logos appeared. Replace it with the 200/400/683 px set and srcset the other sponsors use.
They were the only sponsors served as a single file, up to 1262 px wide. Export the 200/400/683 px set the others have.
Without a sizes attribute a srcset assumes the image spans the whole viewport, so every logo fetched its 683 px file for a 96 to 192 px slot.
The logo <img> tags carried no dimensions, so the footer reflowed as each logo arrived. sponsorCtx now gives templates the logo's intrinsic logoWidth/logoHeight, read with pandoc's imageSize, and the browser reserves the right box before the file loads. The same read fails the build when a logo is wider than maxLogoWidth (1000 px) or not an image, so an export like the 15950 px Standard Chartered one cannot reach the site again: CI runs `site rebuild`. The bytes come from a "bytes" version of assets/images/sponsors/**, loaded rather than read from disk, so pages depend on their logos and `site watch` rebuilds them when one is replaced. A sponsor's logo must therefore live under that directory.
dschrempf
marked this pull request as ready for review
October 14, 2026 14:16
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.
This was annoying me for a long time. When scrolling down to the sponsors, there was a considerable lag. This was because the Standard Chartered logo was huge.
This standardizes the logos, and ensures they stay small (1000px) in CI.
Checklist