Skip to content

Commit 1f459a2

Browse files
authored
Merge pull request #910 from alphagov/add-more-schemas
Add more structured data
2 parents dd34445 + 950c48c commit 1f459a2

23 files changed

+126
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module MachineReadableMetadataHelper
2+
def machine_readable_metadata(args)
3+
locals = { content_item: @content_item.content_item }.merge(args)
4+
render('govuk_publishing_components/components/machine_readable_metadata', locals)
5+
end
6+
end
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% content_for :extra_head_content do %>
2-
<%= render 'govuk_publishing_components/components/machine_readable_metadata',
3-
schema: :article,
4-
content_item: @content_item.content_item %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
55
<% end %>
66

77
<%= render 'content_items/body_with_related_links' %>

app/views/content_items/case_study.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds responsive-top-margin">
39
<%= render 'govuk_component/title', @content_item.title_and_context %>

app/views/content_items/consultation.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title', @content_item.title_and_context %>

app/views/content_items/contact.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<% content_for :simple_header, true %>
28

39
<div class="grid-row">

app/views/content_items/corporate_information_page.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<% @additional_body = capture do %>
28
<% if @content_item.corporate_information? %>
39
<%= @content_item.corporate_information_heading_tag %>

app/views/content_items/detailed_guide.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title', @content_item.title_and_context %>

app/views/content_items/document_collection.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title',

app/views/content_items/fatality_notice.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title', @content_item.title_and_context %>

app/views/content_items/guide.html.erb

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<% content_for :extra_head_content do %>
2-
<%= render 'govuk_publishing_components/components/machine_readable_metadata',
2+
<%= machine_readable_metadata(
33
schema: :article,
4-
content_item: @content_item.content_item,
5-
canonical_url: @content_item.canonical_url %>
4+
canonical_url: @content_item.canonical_url
5+
) %>
66
<% end %>
77

88
<% content_for :simple_header, true %>
9+
910
<div class="grid-row">
1011
<div class="column-two-thirds">
1112
<%= render 'govuk_component/title', { title: @content_item.title } %>
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<%= render 'content_items/body_with_related_links' %>

app/views/content_items/html_publication.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<%
28
content_for :simple_header, true
39
%>

app/views/content_items/news_article.html.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% content_for :extra_head_content do %>
2-
<%= render 'govuk_publishing_components/components/machine_readable_metadata',
2+
<%= machine_readable_metadata(
33
schema: :news_article,
4-
content_item: @content_item.content_item %>
4+
) %>
55
<% end %>
66

77
<div class="grid-row">

app/views/content_items/publication.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title',

app/views/content_items/specialist_document.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<% content_for :simple_header, true %>
28

39
<div class="grid-row">

app/views/content_items/speech.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :news_article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title', @content_item.title_and_context %>

app/views/content_items/statistical_data_set.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title',

app/views/content_items/statistics_announcement.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title', @content_item.title_and_context %>

app/views/content_items/take_part.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title', @content_item.title_and_context %>

app/views/content_items/topical_event_about_page.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<%= render 'shared/title_and_translations', content_item: @content_item %>
28

39
<div class="grid-row">

app/views/content_items/travel_advice.html.erb

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<%= auto_discovery_link_tag :atom, @content_item.feed_link,
55
title: "Recent updates for #{@content_item.country_name}" %>
66

7-
<%= render 'govuk_publishing_components/components/machine_readable_metadata',
7+
<%= machine_readable_metadata(
88
schema: :article,
9-
content_item: @content_item.content_item,
109
canonical_url: @content_item.canonical_url,
1110
title: @content_item.page_title,
12-
body: @content_item.current_part_body %>
11+
body: @content_item.current_part_body
12+
) %>
1313
<% end %>
1414

1515
<div class="grid-row">

app/views/content_items/working_group.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :article
4+
) %>
5+
<% end %>
6+
17
<% @additional_body = capture do %>
28
<% if @content_item.policies.any? %>
39
<h2 id="policies">Policies</h2>

app/views/content_items/world_location_news_article.html.erb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<% content_for :extra_head_content do %>
2+
<%= machine_readable_metadata(
3+
schema: :news_article
4+
) %>
5+
<% end %>
6+
17
<div class="grid-row">
28
<div class="column-two-thirds">
39
<%= render 'govuk_component/title', @content_item.title_and_context %>

0 commit comments

Comments
 (0)