Fix layout shift by introducing width and height attributes to <img> tags - #15
Open
ruppec wants to merge 2 commits into
Open
Fix layout shift by introducing width and height attributes to <img> tags#15ruppec wants to merge 2 commits into
ruppec wants to merge 2 commits into
Conversation
added 2 commits
August 1, 2026 18:51
For some reason on the recent version of hugo on my laptop the previous code wasn't working so I had to add Params in there and in the hugo.toml I had to change the format of the author field.
This fixes an annoyance where when images load in they shift the text around. This is specifically annoying on slower internet speeds or when trying to reload the page on certain devices and it taking you to a different part of the text because of the layout changes cause by loading images. Now the browser should reserve the space the images will later occupy so no late update occurs.
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 PR actually does two things, seperated into the two commits. (Sorry)
The commit messages explains in some detail why you want this but I will repost them here:
This fixes an annoyance where when images load in they shift the text
around. This is specifically annoying on slower internet speeds or when trying
to reload the page on certain devices and it taking you to a different part of
the text because of the layout changes cause by loading images.
Now the browser should reserve the space the images will later occupy so no late
update occurs.
AND
For some reason on the recent version of hugo on my laptop the previous code
wasn't working so I had to add Params in there and in the hugo.toml I had to
change the format of the author field.
I really appreciate all the work you do on the magazine and this is a slight annoyance to me that I'm hoping can be fixed and make the reader's experience more enjoyable!!