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

Reduce responsive image variants #7908

Closed
wants to merge 4 commits into from
Closed

Conversation

nick-mon1
Copy link
Contributor

@nick-mon1 nick-mon1 commented Aug 29, 2024

Summary

Updates code to only generate and serve mobile (800) and desktop (1200) responsive sizes.

Preview

pages that display 800 or 1200
it-warning-banners-how-gsa-is-working-to-stop-unnecessarily-frightening-users
evaluating-your-agency-accessibility-just-got-a-whole-lot-easier-with-gsa-openacr-editor
a-successful-vibrant-productive-career-for-federal-employees
making-gsa-public-art-collection-more-accessible

Note

For some pages, there is only one variant, see below

pages that display other sizes
event/2020/01/14/socialgov-winter-meeting/ (only displays 200px)

Solution

Simplified responsive variants from 4 to 2 sizes. Serving one size for mobile and desktop will not impact performance and quality.

viewport size
mobile/tablet 800
desktop/large scree 1200
What you should see in network panel

image (1) image (2)

Updates the file-process.js to generate the above two sizes.
Updates img.html partial/short code to display above two sizes.

Other variant sizes will be served if the 800 or 1200 is not present.

How To Test

  1. Visit a preview page above
  2. Change viewport from desktop to mobile to see only two sizes loaded
  3. When an image has no 800 or 1200 size, other image size is served

Copy link

🔍 Preview in Federalist

@nick-mon1 nick-mon1 self-assigned this Aug 29, 2024
@nick-mon1 nick-mon1 added Dev: Template Logic Fixes and improvements associated with our static site generator Content: Tools and Services labels Aug 29, 2024
@nick-mon1 nick-mon1 marked this pull request as ready for review August 29, 2024 19:45
@nick-mon1 nick-mon1 added performance performance improvements and removed Content: Tools and Services labels Aug 29, 2024
@RileySeaburg
Copy link
Member

@nick-mon1 did you test upload with this?

Copy link
Member

@RileySeaburg RileySeaburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only get one file, and the file is blank.

image

image

https://s3.amazonaws.com/digitalgov/image-test-rs-9-13.png

@nick-mon1
Copy link
Contributor Author

Thought

@RileySeaburg This is probably not be related to these code changes for displaying and generating the same image types. Still need to address async issues with gulp file upload scripts.

@RileySeaburg
Copy link
Member

RileySeaburg commented Sep 13, 2024

Thought

@RileySeaburg This is probably not be related to these code changes for displaying and generating the same image types. Still need to address async issues with gulp file upload scripts.

@nick-mon1 I would agree completely if the image upload didn't already work. But I do agree this is an async issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev: Template Logic Fixes and improvements associated with our static site generator performance performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants