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] 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