Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switches to lazyimg base #5

Merged
merged 2 commits into from Sep 27, 2022
Merged

Switches to lazyimg base #5

merged 2 commits into from Sep 27, 2022

Conversation

h-enk
Copy link
Member

@h-enk h-enk commented Sep 27, 2022

Adds in addition to hugo-mods/lazyimg:

  • Renderers ./layouts/partials/renderer/figure.html + ./layouts/partials/renderer/figure-webp.html
  • Render hook /layouts/_default/_markup/render-image.html

Fixes W3C Markup Validator errors:

  1. Element noscript not allowed as child of element picture in this context. (Suppressing further errors from this subtree.)
  2. When the srcset attribute has any image candidate string with a width descriptor, the sizes attribute must also be present.

Ad 1. Updated ./layouts/partials/renderer/lqip.html + ./layouts/partials/renderer/lqip-webp.html, and created ./layouts/partials/renderer/img.html
Ad 2. Added to ./layouts/partials/renderer/native.html (on line 8) the sizes default value: sizes="100vw"

Does not support (yet):

  • Remote image
  • Base64 encoded image

@h-enk h-enk linked an issue Sep 27, 2022 that may be closed by this pull request
@h-enk h-enk self-assigned this Sep 27, 2022
@h-enk h-enk added the enhancement New feature or request label Sep 27, 2022
@h-enk h-enk merged commit 67f05be into master Sep 27, 2022
@h-enk h-enk deleted the lazyimg branch September 27, 2022 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add LQIP support
1 participant