mirror of https://github.com/luizdepra/hugo-coder.git

Oliver B. Fischer
yesterday 58d956f41c056a12e15d5b6ee27c54fc98cd6e49
Provide image attributes width and height for Gravatar (#999)

### Prerequisites

Put an `x` into the box(es) that apply:

- [ ] This pull request fixes a bug.
- [x] This pull request adds a feature.
- [ ] This pull request introduces breaking change.

### Description

The img tag for an avatar via Gravatar now specifies the width and
height of the image.

Providing these attributes helps to avoid Cumulative Layout Shift.
Avoiding this improves the page speed ranking of the page.

### Issues Resolved

There is no corresponding issue.

### Checklist

Put an `x` into the box(es) that apply:

#### General

- [x] Describe what changes are being made
- [x] Explain why and how the changes were necessary and implemented
respectively
- [x] Reference issue with `#<ISSUE_NO>` if applicable

#### Resources

- [x] If you have changed any SCSS code, run `make release` to
regenerate all CSS files

#### Contributors

- [X] Add yourself to `CONTRIBUTORS.md` if you aren't on it already

Co-authored-by: Oliver B. Fischer <o.b.fischer@swe-blog.net>
Co-authored-by: Luiz F. A. de Prá <luizdepra@users.noreply.github.com>
2 files modified
3 ■■■■ changed files
CONTRIBUTORS.md 1 ●●●● patch | view | raw | blame | history
layouts/_partials/home/avatar.html 2 ●●● patch | view | raw | blame | history
CONTRIBUTORS.md
@@ -150,6 +150,7 @@
-   [Gregor Podjed](https://github.com/gragorther)
-   [dantezhu](https://github.com/dantezhu)
-   [Alexander Lazarević](https://e11bits.com)
-   [Oliver B. Fischer](https://stdout.oliverfischer.dev)
-   [Ábel Nagy](https://github.com/abel-nagy)
-   [William Floyd](https://w-floyd.com)
-   [Tiago Carrondo](https://carrondo.pt)
layouts/_partials/home/avatar.html
@@ -4,5 +4,5 @@
  {{ end }}
{{ end }}
{{ with .Site.Params.gravatar }}
  <div class="avatar"><img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" alt="gravatar"></div>
  <div class="avatar"><img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" width="240" height="240" alt="gravatar"></div>
{{ end }}