From ca0fc4992beb7c55035b94b1afdbb3aba7bd0390 Mon Sep 17 00:00:00 2001 From: Keith Lawrence Date: Tue, 5 Nov 2024 15:17:41 +0000 Subject: [PATCH 1/5] Add helper to allow remote or local images - Because we might now get images from the content item or locally-supplied, we check the url is a url - if it is, we return it, if not, we try to make an image_path for it and return that. --- app/helpers/block_helper.rb | 6 ++++++ spec/helpers/block_helper_spec.rb | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/app/helpers/block_helper.rb b/app/helpers/block_helper.rb index 9c90cd1281..c70c0a1b46 100644 --- a/app/helpers/block_helper.rb +++ b/app/helpers/block_helper.rb @@ -49,4 +49,10 @@ def column_class_for_assymetric_columns(number_of_columns, column_size) end end end + + # SCAFFOLDING: remove and remove all references when all images are coming from + # assets in the content item, rather than potentially being included in the repo + def block_image_path(url) + url.start_with?("http") ? url : image_path(url) + end end diff --git a/spec/helpers/block_helper_spec.rb b/spec/helpers/block_helper_spec.rb index 8dfc3a14c4..c3ed03edba 100644 --- a/spec/helpers/block_helper_spec.rb +++ b/spec/helpers/block_helper_spec.rb @@ -67,4 +67,14 @@ expect(render_block(block)).to be_empty end end + + describe "#block_image_path" do + it "returns an image path for a local image" do + expect(block_image_path("landing_page/placeholder/desktop.png")).to eq("/images/landing_page/placeholder/desktop.png") + end + + it "returns the original url for a remote image" do + expect(block_image_path("http://www.gov.uk/favicon.png")).to eq("http://www.gov.uk/favicon.png") + end + end end From 579c19168d34590189a7c170a83fb856ef97eaf5 Mon Sep 17 00:00:00 2001 From: Keith Lawrence Date: Tue, 5 Nov 2024 15:19:12 +0000 Subject: [PATCH 2/5] Add HasImageSet concern - this will replace individual image handling in hero and featured blocks. Tests to be added in the commits for the consuming block types. - to simplify calls, we load the sources into an OpenStruct. This is close to how they're currently handled in the blocks, but removes the Dataclass strictness (which allows this to be used more generally). --- .../landing_page/block/concerns/has_image_set.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/models/landing_page/block/concerns/has_image_set.rb diff --git a/app/models/landing_page/block/concerns/has_image_set.rb b/app/models/landing_page/block/concerns/has_image_set.rb new file mode 100644 index 0000000000..8030e9bfa7 --- /dev/null +++ b/app/models/landing_page/block/concerns/has_image_set.rb @@ -0,0 +1,15 @@ +require "ostruct" + +module LandingPage::Block::Concerns + module HasImageSet + FeaturedImage = Data.define(:alt, :sources) + + def image + @image ||= load_image + end + + def load_image + FeaturedImage.new(alt: data["image"]["alt"], sources: OpenStruct.new(data["image"]["sources"])) + end + end +end From c80041d93afa53dad8dc39727ec5e1566fcc4144 Mon Sep 17 00:00:00 2001 From: Keith Lawrence Date: Tue, 5 Nov 2024 15:20:14 +0000 Subject: [PATCH 3/5] Use HasImageSet concern in Hero block. - Update tests and fixtures (local files to be updated in a later commit) --- app/models/landing_page/block/hero.rb | 10 ++----- app/views/landing_page/blocks/_hero.html.erb | 8 ++--- spec/fixtures/landing_page.yaml | 14 ++++----- spec/models/landing_page/block/hero_spec.rb | 31 ++++++++++++-------- 4 files changed, 33 insertions(+), 30 deletions(-) diff --git a/app/models/landing_page/block/hero.rb b/app/models/landing_page/block/hero.rb index b5776129bd..0f498e2c7f 100644 --- a/app/models/landing_page/block/hero.rb +++ b/app/models/landing_page/block/hero.rb @@ -1,16 +1,12 @@ module LandingPage::Block - HeroImageSources = Data.define(:desktop, :desktop_2x, :tablet, :tablet_2x, :mobile, :mobile_2x) - HeroImage = Data.define(:alt, :sources) - class Hero < Base - attr_reader :image, :hero_content + include LandingPage::Block::Concerns::HasImageSet + + attr_reader :hero_content def initialize(block_hash, landing_page) super - alt, sources = data.fetch("image").values_at("alt", "sources") - sources = HeroImageSources.new(**sources) - @image = HeroImage.new(alt:, sources:) @hero_content = LandingPage::BlockFactory.build_all(data.dig("hero_content", "blocks"), landing_page) end diff --git a/app/views/landing_page/blocks/_hero.html.erb b/app/views/landing_page/blocks/_hero.html.erb index a95da83bda..5b7ab108d0 100644 --- a/app/views/landing_page/blocks/_hero.html.erb +++ b/app/views/landing_page/blocks/_hero.html.erb @@ -11,10 +11,10 @@ <%= content_tag("div", class: hero_classes) do %> <%= picture_tag(class: "app-b-hero__imagewrapper") do %> - <%= tag.source srcset: "#{image_path(block.image.sources.desktop)}, #{image_path(block.image.sources.desktop_2x)} 2x", media: "(min-width: 769px)" %> - <%= tag.source srcset: "#{image_path(block.image.sources.tablet)}, #{image_path(block.image.sources.tablet_2x)} 2x", media: "(min-width: 641px) and (max-width: 768px)" %> - <%= tag.source srcset: "#{image_path(block.image.sources.mobile)}, #{image_path(block.image.sources.mobile_2x)} 2x", media: "(max-width: 640px)" %> - <%= image_tag(block.image.sources.desktop, alt: block.image.alt, class: "app-b-hero__image") %> + <%= tag.source srcset: "#{block_image_path(block.image.sources.hero_desktop_1x)}, #{block_image_path(block.image.sources.hero_desktop_2x)} 2x", media: "(min-width: 769px)" %> + <%= tag.source srcset: "#{block_image_path(block.image.sources.hero_tablet_1x)}, #{block_image_path(block.image.sources.hero_tablet_2x)} 2x", media: "(min-width: 641px) and (max-width: 768px)" %> + <%= tag.source srcset: "#{block_image_path(block.image.sources.hero_mobile_1x)}, #{block_image_path(block.image.sources.hero_mobile_2x)} 2x", media: "(max-width: 640px)" %> + <%= image_tag(block.image.sources.hero_desktop_1x, alt: block.image.alt, class: "app-b-hero__image") %> <% end %>
diff --git a/spec/fixtures/landing_page.yaml b/spec/fixtures/landing_page.yaml index 43670b4139..07d2052c66 100644 --- a/spec/fixtures/landing_page.yaml +++ b/spec/fixtures/landing_page.yaml @@ -21,14 +21,14 @@ blocks: navigation_group_id: "Top Menu" - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading diff --git a/spec/models/landing_page/block/hero_spec.rb b/spec/models/landing_page/block/hero_spec.rb index 4c8c228c1d..2dcccd3100 100644 --- a/spec/models/landing_page/block/hero_spec.rb +++ b/spec/models/landing_page/block/hero_spec.rb @@ -4,12 +4,12 @@ "image" => { "alt" => "some alt text", "sources" => { - "desktop" => "landing_page/desktop.jpeg", - "desktop_2x" => "landing_page/desktop_2x.jpeg", - "mobile" => "landing_page/mobile.jpeg", - "mobile_2x" => "landing_page/mobile_2x.jpeg", - "tablet" => "landing_page/tablet.jpeg", - "tablet_2x" => "landing_page/tablet_2x.jpeg", + "hero_desktop_1x" => "landing_page/desktop.png", + "hero_desktop_2x" => "landing_page/desktop_2x.png", + "hero_tablet_1x" => "landing_page/tablet.png", + "hero_tablet_2x" => "landing_page/tablet_2x.png", + "hero_mobile_1x" => "landing_page/mobile.png", + "hero_mobile_2x" => "landing_page/mobile_2x.png", }, }, "hero_content" => { @@ -24,12 +24,19 @@ describe "#image" do it "returns the properties of the image" do expect(subject.image.alt).to eq "some alt text" - expect(subject.image.sources.desktop).to eq "landing_page/desktop.jpeg" - expect(subject.image.sources.desktop_2x).to eq "landing_page/desktop_2x.jpeg" - expect(subject.image.sources.mobile).to eq "landing_page/mobile.jpeg" - expect(subject.image.sources.mobile_2x).to eq "landing_page/mobile_2x.jpeg" - expect(subject.image.sources.tablet).to eq "landing_page/tablet.jpeg" - expect(subject.image.sources.tablet_2x).to eq "landing_page/tablet_2x.jpeg" + end + + it "allows access by source version" do + expect(subject.image.sources.hero_desktop_1x).to eq "landing_page/desktop.png" + expect(subject.image.sources.hero_desktop_2x).to eq "landing_page/desktop_2x.png" + expect(subject.image.sources.hero_tablet_1x).to eq "landing_page/tablet.png" + expect(subject.image.sources.hero_tablet_2x).to eq "landing_page/tablet_2x.png" + expect(subject.image.sources.hero_mobile_1x).to eq "landing_page/mobile.png" + expect(subject.image.sources.hero_mobile_2x).to eq "landing_page/mobile_2x.png" + end + + it "returns nil if the requested version doesn't exist" do + expect(subject.image.sources.hero_desktop_5x).to be_nil end end From a322ce63d5c97d05e9ca506bca95ca0cb5f85afc Mon Sep 17 00:00:00 2001 From: Keith Lawrence Date: Tue, 5 Nov 2024 15:31:48 +0000 Subject: [PATCH 4/5] Use HasImageSet concern for featured block --- app/models/landing_page/block/featured.rb | 10 ++---- .../landing_page/blocks/_featured.html.erb | 8 ++--- spec/fixtures/landing_page.yaml | 14 ++++----- .../landing_page/block/featured_spec.rb | 31 ++++++++++++------- 4 files changed, 33 insertions(+), 30 deletions(-) diff --git a/app/models/landing_page/block/featured.rb b/app/models/landing_page/block/featured.rb index afd760f6c5..85e681baa6 100644 --- a/app/models/landing_page/block/featured.rb +++ b/app/models/landing_page/block/featured.rb @@ -1,16 +1,12 @@ module LandingPage::Block - FeaturedImageSources = Data.define(:desktop, :desktop_2x, :tablet, :tablet_2x, :mobile, :mobile_2x) - FeaturedImage = Data.define(:alt, :sources) - class Featured < Base - attr_reader :image, :featured_content + include LandingPage::Block::Concerns::HasImageSet + + attr_reader :featured_content def initialize(block_hash, landing_page) super - alt, sources = data.fetch("image").values_at("alt", "sources") - sources = FeaturedImageSources.new(**sources) - @image = FeaturedImage.new(alt:, sources:) @featured_content = data.dig("featured_content", "blocks")&.map { |subblock_hash| LandingPage::BlockFactory.build(subblock_hash, landing_page) } end diff --git a/app/views/landing_page/blocks/_featured.html.erb b/app/views/landing_page/blocks/_featured.html.erb index f23006698b..dc7b919551 100644 --- a/app/views/landing_page/blocks/_featured.html.erb +++ b/app/views/landing_page/blocks/_featured.html.erb @@ -10,10 +10,10 @@
diff --git a/spec/fixtures/landing_page.yaml b/spec/fixtures/landing_page.yaml index 07d2052c66..3766ccb797 100644 --- a/spec/fixtures/landing_page.yaml +++ b/spec/fixtures/landing_page.yaml @@ -41,14 +41,14 @@ blocks: href: "todo" - type: featured image: - alt: example alt text + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png featured_content: blocks: - type: heading diff --git a/spec/models/landing_page/block/featured_spec.rb b/spec/models/landing_page/block/featured_spec.rb index 302d5783dd..b2ab73f7a1 100644 --- a/spec/models/landing_page/block/featured_spec.rb +++ b/spec/models/landing_page/block/featured_spec.rb @@ -4,12 +4,12 @@ "image" => { "alt" => "some alt text", "sources" => { - "desktop" => "landing_page/desktop.jpeg", - "desktop_2x" => "landing_page/desktop_2x.jpeg", - "mobile" => "landing_page/mobile.jpeg", - "mobile_2x" => "landing_page/mobile_2x.jpeg", - "tablet" => "landing_page/tablet.jpeg", - "tablet_2x" => "landing_page/tablet_2x.jpeg", + "hero_desktop_1x" => "landing_page/desktop.png", + "hero_desktop_2x" => "landing_page/desktop_2x.png", + "hero_tablet_1x" => "landing_page/tablet.png", + "hero_tablet_2x" => "landing_page/tablet_2x.png", + "hero_mobile_1x" => "landing_page/mobile.png", + "hero_mobile_2x" => "landing_page/mobile_2x.png", }, }, "featured_content" => { @@ -24,12 +24,19 @@ describe "#image" do it "returns the properties of the image" do expect(subject.image.alt).to eq "some alt text" - expect(subject.image.sources.desktop).to eq "landing_page/desktop.jpeg" - expect(subject.image.sources.desktop_2x).to eq "landing_page/desktop_2x.jpeg" - expect(subject.image.sources.mobile).to eq "landing_page/mobile.jpeg" - expect(subject.image.sources.mobile_2x).to eq "landing_page/mobile_2x.jpeg" - expect(subject.image.sources.tablet).to eq "landing_page/tablet.jpeg" - expect(subject.image.sources.tablet_2x).to eq "landing_page/tablet_2x.jpeg" + end + + it "allows access by source version" do + expect(subject.image.sources.hero_desktop_1x).to eq "landing_page/desktop.png" + expect(subject.image.sources.hero_desktop_2x).to eq "landing_page/desktop_2x.png" + expect(subject.image.sources.hero_tablet_1x).to eq "landing_page/tablet.png" + expect(subject.image.sources.hero_tablet_2x).to eq "landing_page/tablet_2x.png" + expect(subject.image.sources.hero_mobile_1x).to eq "landing_page/mobile.png" + expect(subject.image.sources.hero_mobile_2x).to eq "landing_page/mobile_2x.png" + end + + it "returns nil if the requested version doesn't exist" do + expect(subject.image.sources.hero_desktop_5x).to be_nil end end From 83e008f788cc20bb876ed2802e300a96fb4686cd Mon Sep 17 00:00:00 2001 From: Keith Lawrence Date: Tue, 5 Nov 2024 15:35:35 +0000 Subject: [PATCH 5/5] Update local pages to use new format --- .../landing_page_content_items/be_kinder.yaml | 28 ++++++------- .../be_thankful.yaml | 28 ++++++------- .../donate_to_charity.yaml | 28 ++++++------- .../exercise_more.yaml | 28 ++++++------- .../landing_page_content_items/goals.yaml | 28 ++++++------- .../landing_page_content_items/homepage.yaml | 28 ++++++------- .../landing_page.yaml | 42 +++++++++---------- .../learn_something_new.yaml | 28 ++++++------- .../landing_page_content_items/tasks.yaml | 14 +++---- 9 files changed, 126 insertions(+), 126 deletions(-) diff --git a/lib/data/landing_page_content_items/be_kinder.yaml b/lib/data/landing_page_content_items/be_kinder.yaml index b1e2e14a5d..348323d922 100644 --- a/lib/data/landing_page_content_items/be_kinder.yaml +++ b/lib/data/landing_page_content_items/be_kinder.yaml @@ -35,14 +35,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading @@ -91,14 +91,14 @@ blocks: - type: hero theme: middle_left image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: quote diff --git a/lib/data/landing_page_content_items/be_thankful.yaml b/lib/data/landing_page_content_items/be_thankful.yaml index 82fef4f14b..ac2630f475 100644 --- a/lib/data/landing_page_content_items/be_thankful.yaml +++ b/lib/data/landing_page_content_items/be_thankful.yaml @@ -35,14 +35,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading @@ -93,14 +93,14 @@ blocks: - type: hero theme: middle_left image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: quote diff --git a/lib/data/landing_page_content_items/donate_to_charity.yaml b/lib/data/landing_page_content_items/donate_to_charity.yaml index 7a0d7433f0..d40b6f9859 100644 --- a/lib/data/landing_page_content_items/donate_to_charity.yaml +++ b/lib/data/landing_page_content_items/donate_to_charity.yaml @@ -35,14 +35,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading @@ -93,14 +93,14 @@ blocks: - type: hero theme: middle_left image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: quote diff --git a/lib/data/landing_page_content_items/exercise_more.yaml b/lib/data/landing_page_content_items/exercise_more.yaml index 5970e613cf..9e37c50029 100644 --- a/lib/data/landing_page_content_items/exercise_more.yaml +++ b/lib/data/landing_page_content_items/exercise_more.yaml @@ -35,14 +35,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading @@ -93,14 +93,14 @@ blocks: - type: hero theme: middle_left image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: quote diff --git a/lib/data/landing_page_content_items/goals.yaml b/lib/data/landing_page_content_items/goals.yaml index 3bbad4ab64..9f8c0f6564 100644 --- a/lib/data/landing_page_content_items/goals.yaml +++ b/lib/data/landing_page_content_items/goals.yaml @@ -23,14 +23,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading @@ -71,14 +71,14 @@ blocks: - type: hero theme: middle_left image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: quote diff --git a/lib/data/landing_page_content_items/homepage.yaml b/lib/data/landing_page_content_items/homepage.yaml index 45e1c02efd..023d2183f8 100644 --- a/lib/data/landing_page_content_items/homepage.yaml +++ b/lib/data/landing_page_content_items/homepage.yaml @@ -23,14 +23,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading @@ -45,14 +45,14 @@ blocks: href: "/landing-page/goals" - type: featured image: - alt: example alt text + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png featured_content: blocks: - type: heading diff --git a/lib/data/landing_page_content_items/landing_page.yaml b/lib/data/landing_page_content_items/landing_page.yaml index bcd2e66f88..17f13459e2 100644 --- a/lib/data/landing_page_content_items/landing_page.yaml +++ b/lib/data/landing_page_content_items/landing_page.yaml @@ -23,14 +23,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading @@ -43,14 +43,14 @@ blocks: href: "todo" - type: featured image: - alt: example alt text + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png featured_content: blocks: - type: heading @@ -97,14 +97,14 @@ blocks: - type: hero theme: middle_left image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: quote diff --git a/lib/data/landing_page_content_items/learn_something_new.yaml b/lib/data/landing_page_content_items/learn_something_new.yaml index 3d7b6529ab..56f24a17ca 100644 --- a/lib/data/landing_page_content_items/learn_something_new.yaml +++ b/lib/data/landing_page_content_items/learn_something_new.yaml @@ -35,14 +35,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading @@ -93,14 +93,14 @@ blocks: - type: hero theme: middle_left image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: quote diff --git a/lib/data/landing_page_content_items/tasks.yaml b/lib/data/landing_page_content_items/tasks.yaml index c1b04a85e6..86f302e802 100644 --- a/lib/data/landing_page_content_items/tasks.yaml +++ b/lib/data/landing_page_content_items/tasks.yaml @@ -35,14 +35,14 @@ blocks: navigation_group_id: Top Menu - type: hero image: - alt: "Placeholder alt text" + alt_text: "Placeholder alt text" sources: - desktop: "landing_page/placeholder/desktop.png" - desktop_2x: "landing_page/placeholder/desktop_2x.png" - mobile: "landing_page/placeholder/mobile.png" - mobile_2x: "landing_page/placeholder/mobile_2x.png" - tablet: "landing_page/placeholder/tablet.png" - tablet_2x: "landing_page/placeholder/tablet_2x.png" + hero_desktop_1x: landing_page/placeholder/desktop.png + hero_desktop_2x: landing_page/placeholder/desktop_2x.png + hero_tablet_1x: landing_page/placeholder/tablet.png + hero_tablet_2x: landing_page/placeholder/tablet_2x.png + hero_mobile_1x: landing_page/placeholder/mobile.png + hero_mobile_2x: landing_page/placeholder/mobile_2x.png hero_content: blocks: - type: heading