Make the width of Markdown images configurable (fixed at 760px)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- html, hugo
- Domain
- content
Research direction
Read modules/blox/layouts/_markup/render-image.html lines 45-52 where the img tag's sizes and Fit size are fixed at 760. Add site param hugoblox.content.image_width defaulting to 760 and use it there, also raising the largest srcset candidate. Done means images follow the config width with existing sites unchanged.
Written by the indexing model from the issue text.
Description
Prerequisites
Proposal
Make the display width of Markdown images configurable, instead of the fixed 760px in modules/blox/layouts/_markup/render-image.html:
{{- $img_md := $img.Fit "760x760 webp" -}}
...
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
For example, a site parameter that sets both the Fit size and the last sizes value, defaulting to 760 so nothing changes for existing sites:
hugoblox:
content:
image_width: 896
It would also help if the largest srcset candidate went up to twice that width (or the original width, whichever is smaller), so images stay sharp on high-density screens.
Motivation and context
On my blog the article column is 896px wide, so every Markdown image (mostly screenshots of profiler output and code) is 136px narrower than the text around it, and small text in the screenshots is harder to read than it needs to be.
Today the only way to change this is to copy the whole render-image.html into the site and edit two lines, then keep that copy in step with every theme update. The template also declares $max_width, $width and $height but always sets them to "", so there is no hook for this either.
- Dominant language
- HTML
- Stars
- 9.8k
- Forks
- 2.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HugoBlox/kit
-
proposal stale
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Feature request (docs): add an "Accessibility" page documenting HugoBlox's built-in a11y featuresOpenproposal stale
Difficulty 2/5 Half a day Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
-
needs triage
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
needs triage
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
shader-list-other
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ly05010419/MacNativeGames#1691 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
Replace dead Founder's Edition links with cmux Pro payment linkPossibly taken @austinywang claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
manaflow-ai/cmux#34268 · 1 comment ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 84/100
lingdojo/kana-dojo#33553 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Sagargupta16/awesome-mcp-servers#297 ·
Maintainers usually reply within 1 day