Repository navigation
Fingerprint /assets/images URLs in rendered content - #160
Merged
vpetersson merged 1 commit intoOct 23, 2026
Merged
Conversation
After the brand reskin merged, the Zero to Hero diagram on the homepage still showed the old purple palette. The deployed SVG was correct, but content referenced it as /assets/images/d2/zero-to-hero.svg, an unversioned URL served with cache-control max-age=14400, so browsers and the CDN kept the previous file for up to four hours. content.html now passes rendered content through fingerprint-assets.html, which rewrites src="/assets/images/..." to the fingerprinted copy of the same asset. Any future change to a diagram or image gets a new URL. Files not found under assets/ are left as written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
vpetersson
approved these changes
Oct 23, 2026
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.
What
Images referenced from content as
/assets/images/...are now served from fingerprinted URLs.Why
After #159 merged, the Zero to Hero diagram on the homepage still showed the old purple palette. The SVG that was deployed was correct (
last-modified19:33 UTC, navy and orange). But content links it as/assets/images/d2/zero-to-hero.svg, an unversioned URL served withcache-control: max-age=14400. Browsers and the CDN therefore kept serving the previous file for up to four hours. Fetching the same URL with a cache-busting query string returned the new diagram.How
layouts/partials/content.html, which every layout already uses to render page content, now pipes the rendered HTML throughlayouts/partials/fingerprint-assets.html. That partial finds eachsrc="/assets/images/<path>", looks the file up withresources.Get, and swaps in the fingerprintedRelPermalink, for example/images/d2/zero-to-hero.c35360a6….svg. Any later change to a diagram or image therefore gets a new URL. A file that isn't found underassets/is left as written.Verification
hugo --minify --environment productionbuilds cleanly./images/d2/zero-to-hero.<sha256>.svg.srcin the built site resolves to a published file (checked allindex.htmlfiles).bun run lint:markdownpasses.🤖 Generated with Claude Code