-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metadata block for social sharing
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> | ||
<meta name="description" content="<%= page_description %>" /> | ||
<meta property="og:title" content="<%= page_title %>"> | ||
<meta property="og:description" content="<%= page_description %>"> | ||
<meta property="og:url" content="<%= url %>"> | ||
<meta property="og:image" content="<%= featured_image %>"> | ||
<meta property="og:site_name" content="GOV.UK"> | ||
<meta name="twitter:card" content="summary_large_image"> | ||
<meta name="twitter:image:alt" content="<%= block.data["featured_image_alt"] %>"> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters