From b4ecff325d98cb0425a9df37f96f83b6d78d3535 Mon Sep 17 00:00:00 2001 From: noether Date: Thu, 29 Oct 2026 10:50:18 -0600 Subject: [PATCH] fix: center content images (headers/artwork/banner) in the column Images were display:inline under text-align:start with only max-width:100% (caps, never stretches), so any image narrower than the content column hugged the left edge (e.g. covid header 579px in a 640px column -> 61px right gap) and full-width images reached the column edge. Add .markdown img:not([width]) { display:block; margin:.75em auto } in _custom.scss (imported last, wins the cascade). Keying on :not([width]) centers the display images while leaving the inline donation crypto icons (they carry width/height attributes + inline text) untouched. Verified in browser: all 38 content images across 20 pages now have equal left/right gaps; no page has horizontal overflow. --- themes/hugo-book/assets/_custom.scss | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/themes/hugo-book/assets/_custom.scss b/themes/hugo-book/assets/_custom.scss index 17af8ac..3cd4d6a 100644 --- a/themes/hugo-book/assets/_custom.scss +++ b/themes/hugo-book/assets/_custom.scss @@ -12,3 +12,25 @@ ... } */ + +// Center content images. +// +// The theme ships `img { max-width: 100%; height: auto }` (caps width, never +// stretches) and images are inline under `text-align: start`, so any image +// narrower than the content column hugs the left edge instead of centering, +// and full-width images reach the column edge (reads as "flowing off"). +// +// Display images (markdown `![...](...)` — headers, artwork, banner) carry NO +// width attribute; inline icons (e.g. the donation crypto icons) DO carry +// width/height attributes plus inline text. Keying on `:not([width])` centers +// the display images and leaves the icon+label layout untouched. +// +// `display: block` + auto left/right margins centers horizontally; the small +// vertical margin restores the line gap between stacked images (a header and +// its artwork share one

) so they don't sit flush. +.markdown img:not([width]) { + display: block; + margin: 0.75em auto; + max-width: 100%; + height: auto; +}