Post images are page bundle resources
Owner:
Ivan Hawkes
Post images as page bundle resources
Every image a post uses lives in the post’s branch bundle, beside index.md, so
Hugo exposes it as a page resource resolvable by bare filename.
Post images as page bundle resources
- Every image file a post uses sits in the root of that post’s bundle: no
images/sub-folder remains undercontent/, and no post image lives instatic/img/(only site chrome:favicon.png,apple-icon.png). - Every image path written in a post body resolves to a resource of that
post. The two
.pngreferences incontent/post/cryengine/matrices-vectors-quaternions-and-cryengine-3/index.mdpointed at files that were never in the bundle; they now show the glyphs they depicted, φ, θ, ψ and ℍ. - Image resources keep bare filenames, so the
imgB-<md5>-LQIPclass the render hooks emit matches the class generated bybe-best/layouts/_partials/images/image-process.html. All 7 image paths in post bodies are bare filenames, and each has a matching rule in the<style>block of the page that uses it.
Acceptance Criteria
find content -type d -name imagesprints nothing.grep -rl '/img/' content/postprints nothing.hugo --quietsucceeds andgrep -rl 'Image unavailable' public/post/prints nothing.- For
content/post/cryengine/creating-interesting-terrain/world-machine.webp, theimgB-<md5>class in the article HTML matches a rule in the generated<style>block of that page. - The four
content/post/general/building-a-joystick/*.jpegresources, which no post body references, are named as carousel slides byp2-ft-post-image-carousel.
Not in scope
- Responsive carousel rendering of the enumerated images:
p2-ft-post-image-carousel. - Scaling, format conversion and compression:
p2-us-image-processing. - Featured image srcset sizing in cards:
p2-us-featured-images.