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

Add support for landing page images in image / featured blocks #9662

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

richardTowers
Copy link
Contributor

@richardTowers richardTowers commented Nov 27, 2024

What

Adds support for "landing page" images, which are a different size to the default images in whitehall.

These can be used in two types of "block" - the image block, and the featured block. The code to present these blocks is updated to transform: [Image: blah.png] to the appropriate asset URLs, as we do for the hero blocks.

Largely for consistency with hero blocks, the config we're expecting users to write is:

sources:
  desktop: "[Image: blah.png]"
  tablet: "[Image: blah.png]"
  mobile: "[Image: blah.png]"

However, as the aspect ratios of each image are the same (just different sizes), rather than adding three image kinds with two variants (1x / 2x) each, I've just added one image kind with six variants. Since we don't need or want to do art direction, I expect that we'll just upload one image and use it for all three sources (desktop / tablet / mobile).

It might be better in future just to do source: instead of sources: for these images, but I think that's a change which will likely confuse us at this point, so I'm sticking with the same structure as heros.

I'll update our blocks documentation once this merges.

Screenshots

image

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Base automatically changed from validate-landing-pages-active-model to main November 27, 2024 16:59
Copy link
Contributor

@KludgeKML KludgeKML left a comment

Choose a reason for hiding this comment

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

LGTM (probably needs whitehall team approve too though)

@richardTowers richardTowers marked this pull request as ready for review November 27, 2024 17:22
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

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

LGTM, but one thing threw me:

config/image_kinds.yml Show resolved Hide resolved
@richardTowers richardTowers merged commit 5e9bf71 into main Nov 28, 2024
19 checks passed
@richardTowers richardTowers deleted the landing-page-featured-images-2 branch November 28, 2024 09:54
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.

3 participants