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

refactor: use Canto asset for homepage #593

Closed
wants to merge 5 commits into from
Closed

refactor: use Canto asset for homepage #593

wants to merge 5 commits into from

Conversation

alexgoff
Copy link
Contributor

Test with: lsst-epo/rubin-obs-api#311

This refactor adds a field to the homepage for a hero image loaded from Canto. If the Canto asset is specified, it will override any Google asset.

Adds the following to the client:

  • basic typings for Canto responses
  • Canto image used for homepage OpenGraph
  • extend homepage server tree so that image element is rendered on the server and can begin client load immediately
  • use Canto resizes to generate a srcset that browsers can use to determine if a smaller image size can be used (mostly for mobile)
  • uses Canto 100px size as a placeholder image

To test:

  • In Craft
    • Select a new hero image in the Canto field on the homepage
  • On client
    • Go to homepage
    • See that new image is in the hero
    • See that new image is in the OpenGraph tags in the header
    • Check the network tab, there should be a request under img for 2050, which is the largest Canto resize and the most likely to be loaded on a desktop since our page is fixed at 2000px wide.
    • Reload the page with a mobile device (Pixel 7 or an iPhone) selected from responsive mode
      • Check the network tab, see that a smaller size request was made (it will probably be 800)
    • Feedback
      • any noticeable performance difference between previous image and the new Canto image?
      • is the low-res 100px placeholder image working well as a placeholder, or is it distracting?

@alexgoff alexgoff requested a review from ericdrosas87 October 23, 2024 18:08
@alexgoff alexgoff self-assigned this Oct 23, 2024
@alexgoff alexgoff force-pushed the develop branch 2 times, most recently from e2e8806 to c6edc1d Compare October 30, 2024 19:12
@alexgoff alexgoff closed this Nov 12, 2024
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.

1 participant