From df685e23c4f7cd196c2ccee4b6fd3d24dbf4e693 Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:38:19 +0000 Subject: [PATCH 1/3] Add metadata block for social sharing --- .../landing_page/blocks/_metadata.html.erb | 21 +++++++++++++++++++ .../landing_page_content_items/be_kinder.yaml | 5 +++++ .../be_thankful.yaml | 5 +++++ .../donate_to_charity.yaml | 5 +++++ .../exercise_more.yaml | 5 +++++ .../landing_page_content_items/goals.yaml | 5 +++++ .../landing_page_content_items/homepage.yaml | 5 +++++ .../learn_something_new.yaml | 5 +++++ .../landing_page_content_items/tasks.yaml | 5 +++++ 9 files changed, 61 insertions(+) create mode 100644 app/views/landing_page/blocks/_metadata.html.erb diff --git a/app/views/landing_page/blocks/_metadata.html.erb b/app/views/landing_page/blocks/_metadata.html.erb new file mode 100644 index 0000000000..4cacefc170 --- /dev/null +++ b/app/views/landing_page/blocks/_metadata.html.erb @@ -0,0 +1,21 @@ +<% + page_title = @content_item.title + page_title = block.data["title"] if block.data["title"] + + page_description = @content_item.description + page_description = block.data["description"] if block.data["description"] + + featured_image = image_path(block.data["featured_image"]) + + url = "https://www.gov.uk" + @content_item.base_path +%> +<% content_for :extra_headers do %> + + + + + + + + "> +<% end %> diff --git a/lib/data/landing_page_content_items/be_kinder.yaml b/lib/data/landing_page_content_items/be_kinder.yaml index b1e2e14a5d..42e79d93be 100644 --- a/lib/data/landing_page_content_items/be_kinder.yaml +++ b/lib/data/landing_page_content_items/be_kinder.yaml @@ -31,6 +31,11 @@ navigation_groups: - text: Be thankful href: "/landing-page/be-thankful" blocks: +- type: metadata + featured_image: landing_page/placeholder/desktop.png + featured_image_alt: a grey placeholder image + title: "Add title here to override Whitehall" + description: "Add description here to override Whitehall" - type: main_navigation navigation_group_id: Top Menu - type: hero diff --git a/lib/data/landing_page_content_items/be_thankful.yaml b/lib/data/landing_page_content_items/be_thankful.yaml index 82fef4f14b..4f390001a4 100644 --- a/lib/data/landing_page_content_items/be_thankful.yaml +++ b/lib/data/landing_page_content_items/be_thankful.yaml @@ -31,6 +31,11 @@ navigation_groups: - text: Be thankful href: "/landing-page/be-thankful" blocks: +- type: metadata + featured_image: landing_page/placeholder/desktop.png + featured_image_alt: a grey placeholder image + title: "Add title here to override Whitehall" + description: "Add description here to override Whitehall" - type: main_navigation navigation_group_id: Top Menu - type: hero 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..08a9f98572 100644 --- a/lib/data/landing_page_content_items/donate_to_charity.yaml +++ b/lib/data/landing_page_content_items/donate_to_charity.yaml @@ -31,6 +31,11 @@ navigation_groups: - text: Be thankful href: "/landing-page/be-thankful" blocks: +- type: metadata + featured_image: landing_page/placeholder/desktop.png + featured_image_alt: a grey placeholder image + title: "Add title here to override Whitehall" + description: "Add description here to override Whitehall" - type: main_navigation navigation_group_id: Top Menu - type: hero diff --git a/lib/data/landing_page_content_items/exercise_more.yaml b/lib/data/landing_page_content_items/exercise_more.yaml index 5970e613cf..64300ea7dc 100644 --- a/lib/data/landing_page_content_items/exercise_more.yaml +++ b/lib/data/landing_page_content_items/exercise_more.yaml @@ -31,6 +31,11 @@ navigation_groups: - text: Be thankful href: "/landing-page/be-thankful" blocks: +- type: metadata + featured_image: landing_page/placeholder/desktop.png + featured_image_alt: a grey placeholder image + title: "Add title here to override Whitehall" + description: "Add description here to override Whitehall" - type: main_navigation navigation_group_id: Top Menu - type: hero diff --git a/lib/data/landing_page_content_items/goals.yaml b/lib/data/landing_page_content_items/goals.yaml index 3bbad4ab64..dc5415af98 100644 --- a/lib/data/landing_page_content_items/goals.yaml +++ b/lib/data/landing_page_content_items/goals.yaml @@ -19,6 +19,11 @@ navigation_groups: - text: Be thankful href: "/landing-page/be-thankful" blocks: +- type: metadata + featured_image: landing_page/placeholder/desktop.png + featured_image_alt: a grey placeholder image + title: "Add title here to override Whitehall" + description: "Add description here to override Whitehall" - type: main_navigation navigation_group_id: Top Menu - type: hero diff --git a/lib/data/landing_page_content_items/homepage.yaml b/lib/data/landing_page_content_items/homepage.yaml index b11c061709..64529cd081 100644 --- a/lib/data/landing_page_content_items/homepage.yaml +++ b/lib/data/landing_page_content_items/homepage.yaml @@ -19,6 +19,11 @@ navigation_groups: - text: Be thankful href: "/landing-page/be-thankful" blocks: +- type: metadata + featured_image: landing_page/placeholder/desktop.png + featured_image_alt: a grey placeholder image + title: "Add title here to override Whitehall" + description: "Add description here to override Whitehall" - type: main_navigation navigation_group_id: Top Menu - type: hero 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..1ea1db4a58 100644 --- a/lib/data/landing_page_content_items/learn_something_new.yaml +++ b/lib/data/landing_page_content_items/learn_something_new.yaml @@ -31,6 +31,11 @@ navigation_groups: - text: Be thankful href: "/landing-page/be-thankful" blocks: +- type: metadata + featured_image: landing_page/placeholder/desktop.png + featured_image_alt: a grey placeholder image + title: "Add title here to override Whitehall" + description: "Add description here to override Whitehall" - type: main_navigation navigation_group_id: Top Menu - type: hero diff --git a/lib/data/landing_page_content_items/tasks.yaml b/lib/data/landing_page_content_items/tasks.yaml index 47b51c91cd..1b710f0cff 100644 --- a/lib/data/landing_page_content_items/tasks.yaml +++ b/lib/data/landing_page_content_items/tasks.yaml @@ -31,6 +31,11 @@ navigation_groups: - text: Be thankful href: "/landing-page/be-thankful" blocks: +- type: metadata + featured_image: landing_page/placeholder/desktop.png + featured_image_alt: a grey placeholder image + title: "Add title here to override Whitehall" + description: "Add description here to override Whitehall" - type: main_navigation navigation_group_id: Top Menu - type: hero From 68d0d5b584c973e0a80116c642c2adc3808caddc Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:54:39 +0000 Subject: [PATCH 2/3] PR Change: remove metadata block, use content item for most values --- .../landing_page/blocks/_metadata.html.erb | 21 ------------------- app/views/landing_page/show.html.erb | 12 +++++++++++ .../landing_page_content_items/be_kinder.yaml | 5 ----- .../be_thankful.yaml | 5 ----- .../donate_to_charity.yaml | 5 ----- .../exercise_more.yaml | 5 ----- .../landing_page_content_items/goals.yaml | 5 ----- .../landing_page_content_items/homepage.yaml | 5 ----- .../learn_something_new.yaml | 5 ----- .../landing_page_content_items/tasks.yaml | 5 ----- 10 files changed, 12 insertions(+), 61 deletions(-) delete mode 100644 app/views/landing_page/blocks/_metadata.html.erb diff --git a/app/views/landing_page/blocks/_metadata.html.erb b/app/views/landing_page/blocks/_metadata.html.erb deleted file mode 100644 index 4cacefc170..0000000000 --- a/app/views/landing_page/blocks/_metadata.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<% - page_title = @content_item.title - page_title = block.data["title"] if block.data["title"] - - page_description = @content_item.description - page_description = block.data["description"] if block.data["description"] - - featured_image = image_path(block.data["featured_image"]) - - url = "https://www.gov.uk" + @content_item.base_path -%> -<% content_for :extra_headers do %> - - - - - - - - "> -<% end %> diff --git a/app/views/landing_page/show.html.erb b/app/views/landing_page/show.html.erb index 7328b8cf09..26e3469654 100644 --- a/app/views/landing_page/show.html.erb +++ b/app/views/landing_page/show.html.erb @@ -2,6 +2,18 @@ add_view_stylesheet("landing_page") %> +<% content_for :extra_headers do %> + + + + "> + + + + +<% end %> + +