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

feat: add 11ty image plugin for image optimization #79

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

zeroedin
Copy link
Collaborator

@zeroedin zeroedin commented Jul 19, 2023

What I did

  • Added eleventy-img plugin which helps optimize image loading by providing correct height and width for images and enables defaults of loading="lazy"
  • Created a rhb-img component that uses the webc based implementation of the eleventy-img plugin. Modified to always output the same format as the extension of the image. As well as provide a data-attr to track the original src to help link the hashed image.
  • Removed public folder in favor of just assets. This helps align the webc expectation of a local path in the src before transformation instead of a standard img tags end source of /assets/*
  • Updated all pages to relink images using new paths
  • Replaced all instances of missing alt attributes on images with alt="[ERROR: MISSING ALT TAG]" these will need resolved before merging see Missing alt tags #78
  • Removed image calls to external sources (ie red hat logo in footer, and favicon) linking to RHDC, this was a lighthouse optimization (cookies) as well as enabling the webc image component.
  • Moved video poster images to their own folder assets/posters as they are not standard images.
  • Updated rollup.config to match pathing changes
  • BONUS: Added font-display: swap; to font css as a Lighthouse optimization.

Closes #38

TODO:

  • Fix missing alt tags with proper descriptive text

Testing instructions

  • View Deploy preview, look for broken links

@changeset-bot
Copy link

changeset-bot bot commented Jul 19, 2023

⚠️ No Changeset found

Latest commit: 8455380

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jul 19, 2023

Deploy Preview for prismatic-souffle-43beb6 failed.

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/prismatic-souffle-43beb6/deploys/64b94935142fcf0f059362a9

@zeroedin zeroedin changed the title feat: add 11ty image plugin for image optomization feat: add 11ty image plugin for image optimization Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider adopting eleventy-img as an optimization.
1 participant