govuk_publishing_components 8.2.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/govuk-logo.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/icon-pointer-2x.png +0 -0
  4. data/app/assets/images/govuk_publishing_components/icon-pointer.png +0 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +4 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +3 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +70 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +134 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +29 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +123 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +33 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +15 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +34 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +111 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +11 -0
  17. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +25 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +306 -0
  19. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +49 -0
  20. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +25 -0
  21. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +27 -0
  22. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +22 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +42 -0
  24. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +32 -0
  25. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +22 -0
  26. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +26 -0
  27. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +15 -0
  28. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +29 -0
  29. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +29 -0
  30. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +24 -0
  31. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +24 -0
  32. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +38 -0
  33. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +224 -0
  34. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +41 -0
  35. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/form-download.scss +24 -0
  36. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss +25 -0
  37. data/app/assets/stylesheets/govuk_publishing_components/components/print/_contents-list.scss +19 -0
  38. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss +5 -0
  39. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +65 -0
  40. data/app/views/govuk_publishing_components/component_guide/example.html.erb +1 -1
  41. data/app/views/govuk_publishing_components/component_guide/index.html.erb +1 -1
  42. data/app/views/govuk_publishing_components/component_guide/show.html.erb +3 -3
  43. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +84 -0
  44. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +14 -0
  45. data/app/views/govuk_publishing_components/components/_govspeak_html_publication.html.erb +9 -0
  46. data/app/views/govuk_publishing_components/components/_image_card.html.erb +41 -0
  47. data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +0 -3
  48. data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -0
  49. data/app/views/govuk_publishing_components/components/_notice.html.erb +22 -0
  50. data/app/views/govuk_publishing_components/components/_share_links.html.erb +68 -30
  51. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +218 -0
  52. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +653 -0
  53. data/app/views/govuk_publishing_components/components/docs/govspeak_html_publication.yml +183 -0
  54. data/app/views/govuk_publishing_components/components/docs/image_card.yml +160 -0
  55. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
  56. data/app/views/govuk_publishing_components/components/docs/machine_readable_metadata.yml +17 -1
  57. data/app/views/govuk_publishing_components/components/docs/notice.yml +27 -0
  58. data/app/views/govuk_publishing_components/components/docs/share_links.yml +119 -18
  59. data/config/initializers/assets.rb +3 -0
  60. data/config/locales/en.yml +2 -0
  61. data/lib/govuk_publishing_components.rb +2 -1
  62. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +27 -0
  63. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +55 -0
  64. data/lib/govuk_publishing_components/presenters/machine_readable/article_schema.rb +5 -1
  65. data/lib/govuk_publishing_components/presenters/machine_readable/page.rb +5 -1
  66. data/lib/govuk_publishing_components/presenters/machine_readable/person_schema.rb +39 -0
  67. data/lib/govuk_publishing_components/presenters/schema_org.rb +3 -0
  68. data/lib/govuk_publishing_components/version.rb +1 -1
  69. metadata +49 -4
  70. data/app/assets/javascripts/govuk_publishing_components/lib/track-share-button-clicks.js +0 -26
  71. data/lib/govuk_publishing_components/presenters/sanitisation.rb +0 -13
@@ -0,0 +1,183 @@
1
+ name: "Govspeak content (HTML Publications)"
2
+ description: "To display long form text with numbered parts, which has been converted from Govspeak"
3
+ body: |
4
+ This component calls the standard [Govspeak component](/components/govspeak), and layers a set of overriding styles on top. Styles for numbered parts are added, and heading sizes are increased.
5
+
6
+ Requires Slimmer >= 9.1.0 for nested component support.
7
+ accessibility_criteria: |
8
+ - headings must be part of a correct heading structure for the page
9
+ - text should have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
10
+ shared_accessibility_criteria:
11
+ - link
12
+ examples:
13
+ basic_content:
14
+ data:
15
+ content: |
16
+ <p>This is a Budget that puts security first. It ensures economic security for working people by putting the public finances in order and setting out a bold plan for a more productive, balanced economy.</p>
17
+ heading_level_2:
18
+ data:
19
+ content: |
20
+ <h2>
21
+ <span class="number">1. </span>Executive summary
22
+ </h2>
23
+ <p>This is a Budget that puts security first. It ensures economic security for working people by putting the public finances in order and setting out a bold plan for a more productive, balanced economy.</p>
24
+ heading_level_3:
25
+ data:
26
+ content: |
27
+ <h3>
28
+ <span class="number">1.1 </span>Fixing the public finances and running a surplus
29
+ </h3>
30
+ <p>The government’s long-term economic plan has laid the foundations for a stronger economy, and the UK’s recovery is now well established. The labour market remains strong, and in the 3 months to April 2015, employment was around record levels at 31.1 million.</p>
31
+ numbered_content:
32
+ data:
33
+ content: |
34
+ <h2 id="executive-summary">
35
+ <span class="number">1. </span>Executive summary
36
+ </h2>
37
+ <p>This is a Budget that puts security first. It ensures economic security for working people by putting the public finances in order and setting out a bold plan for a more productive, balanced economy.</p>
38
+ <h3 id="fixing-the-public-finances-and-running-a-surplus">
39
+ <span class="number">1.1 </span>Fixing the public finances and running a surplus
40
+ </h3>
41
+ <p>The government’s long-term economic plan has laid the foundations for a stronger economy, and the UK’s recovery is now well established. The labour market remains strong, and in the 3 months to April 2015, employment was around record levels at 31.1 million.</p>
42
+ <h3 id="economic-forecast">
43
+ <span class="number">1.2 </span>Economic forecast
44
+ </h3>
45
+ <p>The Office for Budget Responsibility (OBR) forecasts GDP growth of 2.4% in 2015, 2.3% in 2016, and 2.4% for the remainder of the forecast period.</p>
46
+ <h2 id="the-uk-economy-and-public-finances">
47
+ <span class="number">2. </span>The UK economy and public finances
48
+ </h2>
49
+ <h3 id="uk-economy">
50
+ <span class="number">2.1 </span>UK economy
51
+ </h3>
52
+ <p>The government’s long‑term economic plan has secured the recovery. The government’s fiscal responsibility has allowed monetary activism to support demand in the economy alongside repair of the financial sector. This has been supported by supply-side reform to deliver sustainable increases in standards of living.</p>
53
+ right_to_left:
54
+ data:
55
+ direction: 'rtl'
56
+ content: |
57
+ <h2>
58
+ <span class="number">1. </span>Executive summary
59
+ </h2>
60
+ <p>This is a Budget that puts security first. It ensures economic security for working people by putting the public finances in order and setting out a bold plan for a more productive, balanced economy.</p>
61
+ <h3>
62
+ <span class="number">1.1 </span>Fixing the public finances and running a surplus
63
+ </h3>
64
+ <p>The government’s long-term economic plan has laid the foundations for a stronger economy, and the UK’s recovery is now well established. The labour market remains strong, and in the 3 months to April 2015, employment was around record levels at 31.1 million.</p>
65
+ <h3>
66
+ <span class="number">1.2 </span>Economic forecast
67
+ </h3>
68
+ <p>The Office for Budget Responsibility (OBR) forecasts GDP growth of 2.4% in 2015, 2.3% in 2016, and 2.4% for the remainder of the forecast period.</p>
69
+ <h2>
70
+ <span class="number">2. </span>The UK economy and public finances
71
+ </h2>
72
+ <h3>
73
+ <span class="number">2.1 </span>UK economy
74
+ </h3>
75
+ <p>The government’s long‑term economic plan has secured the recovery. The government’s fiscal responsibility has allowed monetary activism to support demand in the economy alongside repair of the financial sector. This has been supported by supply-side reform to deliver sustainable increases in standards of living.</p>
76
+ financial_table:
77
+ data:
78
+ content: |
79
+ <table class="financial-data">
80
+ <caption>Table 1.6: Total Managed Expenditure (as produced by the <a href="https://alphagov.github.io/table-editor/financial-tables.html">financial table editor</a>)</caption>
81
+ <thead>
82
+ <tr>
83
+ <td></td>
84
+ <th class="numeric">2015-16</th>
85
+ <th class="numeric">2016-17</th>
86
+ <th class="numeric">2017-18</th>
87
+ <th class="numeric">2018-19</th>
88
+ <th class="numeric">2019-20</th>
89
+ <th class="numeric">2020-21</th>
90
+ </tr>
91
+ </thead>
92
+ <tbody>
93
+ <tr class="section-heading">
94
+ <th colspan="7">Current Expenditure</th>
95
+ </tr>
96
+ <tr>
97
+ <th>Resource AME</th>
98
+ <td class="numeric">345.3</td>
99
+ <td class="numeric">353.3</td>
100
+ <td class="numeric">365.9</td>
101
+ <td class="numeric">378.4</td>
102
+ <td class="numeric">391.8</td>
103
+ <td class="numeric">403.9</td>
104
+ </tr>
105
+ <tr>
106
+ <th>Resource DEL excluding depreciation</th>
107
+ <td class="numeric">315.1</td>
108
+ <td class="numeric">320.8</td>
109
+ <td class="numeric">322.9</td>
110
+ <td class="numeric">325.2</td>
111
+ <td class="numeric">328.3</td>
112
+ <td class="numeric">341.2</td>
113
+ </tr>
114
+ <tr>
115
+ <th>Ring-fenced depreciation</th>
116
+ <td class="numeric">21.9</td>
117
+ <td class="numeric">21.9</td>
118
+ <td class="numeric">21.9</td>
119
+ <td class="numeric">21.9</td>
120
+ <td class="numeric">21.9</td>
121
+ <td class="numeric">21.9</td>
122
+ </tr>
123
+ <tr class="subtotal">
124
+ <th>Public Sector Current Expenditure</th>
125
+ <td class="numeric">682.3</td>
126
+ <td class="numeric">696.0</td>
127
+ <td class="numeric">710.7</td>
128
+ <td class="numeric">725.5</td>
129
+ <td class="numeric">742.0</td>
130
+ <td class="numeric">767.0</td>
131
+ </tr>
132
+ <tr class="section-heading">
133
+ <th colspan="7">Capital Expenditure</th>
134
+ </tr>
135
+ <tr>
136
+ <th>Capital AME</th>
137
+ <td class="numeric">31.7</td>
138
+ <td class="numeric">33.4</td>
139
+ <td class="numeric">31.7</td>
140
+ <td class="numeric">30.7</td>
141
+ <td class="numeric">31.7</td>
142
+ <td class="numeric">34.5</td>
143
+ </tr>
144
+ <tr>
145
+ <th>Capital DEL</th>
146
+ <td class="numeric">41.7</td>
147
+ <td class="numeric">44.0</td>
148
+ <td class="numeric">45.0</td>
149
+ <td class="numeric">45.0</td>
150
+ <td class="numeric">47.3</td>
151
+ <td class="numeric">55.7</td>
152
+ </tr>
153
+ <tr class="subtotal">
154
+ <th>Public Sector Gross Investment</th>
155
+ <td class="numeric">73.4</td>
156
+ <td class="numeric">77.4</td>
157
+ <td class="numeric">76.7</td>
158
+ <td class="numeric">75.7</td>
159
+ <td class="numeric">79.0</td>
160
+ <td class="numeric">90.2</td>
161
+ </tr>
162
+ </tbody>
163
+ <tfoot>
164
+ <tr class="total">
165
+ <th>Total Managed Expenditure</th>
166
+ <td class="numeric">755.7</td>
167
+ <td class="numeric">773.3</td>
168
+ <td class="numeric">787.5</td>
169
+ <td class="numeric">801.2</td>
170
+ <td class="numeric">821.0</td>
171
+ <td class="numeric">857.2</td>
172
+ </tr>
173
+ <tr>
174
+ <th>Total Managed Expenditure (% GDP)</th>
175
+ <td class="numeric">39.7%</td>
176
+ <td class="numeric">39.1%</td>
177
+ <td class="numeric">38.1%</td>
178
+ <td class="numeric">37.2%</td>
179
+ <td class="numeric">36.5%</td>
180
+ <td class="numeric">36.4%</td>
181
+ </tr>
182
+ </tfoot>
183
+ </table>
@@ -0,0 +1,160 @@
1
+ name: Image card
2
+ description: Image and associated text with a link
3
+ body: |
4
+ An image and an associated link, meant for use for news articles and people. Includes optional paragraph and additional links.
5
+
6
+ The component is generally to be used within a grid column but has no grid of its own, so the text and the images in the examples below may not always line up. This will normally look tidier, for example [on pages like this](https://www.gov.uk/government/organisations/attorney-generals-office).
7
+ accessibility_criteria: |
8
+ The component must:
9
+
10
+ - include alt text for images when present
11
+ - not have duplicate links for the image and the text
12
+ shared_accessibility_criteria:
13
+ - link
14
+ examples:
15
+ default:
16
+ data:
17
+ href: "/not-a-page"
18
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
19
+ image_alt: "some meaningful alt text please"
20
+ heading_text: "News headline"
21
+ with_a_different_heading_level:
22
+ description: Use a different heading level for the main link title. Defaults to H2 if not passed.
23
+ data:
24
+ href: "/really-not-a-page"
25
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
26
+ image_alt: "some meaningful alt text please"
27
+ heading_text: "I am a heading level 3"
28
+ heading_level: 3
29
+ with_more_information:
30
+ data:
31
+ href: "/also-not-a-page"
32
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
33
+ image_alt: "some meaningful alt text please"
34
+ context: "10 May 2018 - Press release"
35
+ heading_text: "Government does things"
36
+ description: "Following a thorough review of existing procedure, a government body has today announced that further work is necessary."
37
+ with_extra_links:
38
+ data:
39
+ href: "/a-page-no-just-kidding"
40
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
41
+ image_alt: "some meaningful alt text please"
42
+ heading_text: "Some more links"
43
+ description: "Greater transparency across government is at the heart of our commitment to let you hold politicians and public bodies to account."
44
+ extra_links: [
45
+ {
46
+ text: "Single departmental plans",
47
+ href: "/1"
48
+ },
49
+ {
50
+ text: "Prime Minister's and Cabinet Office ministers' transparency publications",
51
+ href: "/2"
52
+ },
53
+ {
54
+ text: "Government transparency data",
55
+ href: "/3"
56
+ },
57
+ ]
58
+ extra_links_without_indent:
59
+ description: Don't indent the extra links. Used for links to people pages.
60
+ data:
61
+ href: "/government/people/"
62
+ image_src: "http://placekitten.com/215/140"
63
+ image_alt: "some meaningful alt text please"
64
+ context: "The Rt Hon"
65
+ heading_text: "John Whiskers MP"
66
+ extra_links: [
67
+ {
68
+ text: "Minister for Cats",
69
+ href: "/government/ministers/"
70
+ }
71
+ ]
72
+ extra_links_no_indent: true
73
+ without_heading_text:
74
+ description: |
75
+ The only required parameter to the component is href but if no heading_text is supplied the link will not appear. This is to allow the component to use only extra links as shown.
76
+
77
+ In this situation the link could have been applied to the image but having a link on the image like this without text can be confusing.
78
+ data:
79
+ href: "/still-not-a-link"
80
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
81
+ image_alt: "some meaningful alt text please"
82
+ description: Here are some links to more information about the thing you are reading about.
83
+ extra_links: [
84
+ {
85
+ text: "More information",
86
+ href: "/1"
87
+ },
88
+ {
89
+ text: "Even more information",
90
+ href: "/2"
91
+ },
92
+ {
93
+ text: "One final bit of information we forgot to mention",
94
+ href: "/2"
95
+ }
96
+ ]
97
+ without_an_image:
98
+ description: Despite the name of the component, it is possible to have it display without an image.
99
+ data:
100
+ href: '/no-valid-links-here'
101
+ heading_text: 'John McJohnson'
102
+ description: 'Deputy director for Parks and Small Trees'
103
+ with_branding:
104
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
105
+ data:
106
+ brand: "department-for-work-pensions"
107
+ href: "/again-not-a-page"
108
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
109
+ image_alt: "some meaningful alt text please"
110
+ heading_text: "Something relating to this"
111
+ description: "Public reform committee consultation vote department interior minister referendum."
112
+ extra_links: [
113
+ {
114
+ text: "Something",
115
+ href: "/1"
116
+ },
117
+ {
118
+ text: "Something else",
119
+ href: "/2"
120
+ }
121
+ ]
122
+ large_version:
123
+ data:
124
+ large: true
125
+ href: "/still-not-a-page"
126
+ image_src: "https://assets.publishing.service.gov.uk/frontend/homepage/leaving-the-eu-bc9992ee672a30d8e8a3e195c9afa750e618748130a4e073a593ba36dfc29af9.jpg"
127
+ image_alt: "some meaningful alt text please"
128
+ context: "14 Jun 2017 - Announcement"
129
+ heading_text: "Something has happened nearby possibly"
130
+ description: "Following a news report that something has happened, further details are emerging of the thing that has happened and what that means for you."
131
+ with_tracking:
132
+ data:
133
+ href: "/i-am-not-a-valid-link"
134
+ href_data_attributes: {
135
+ track_category: 'href_category',
136
+ track_action: 1.1,
137
+ track_label: 'href_label',
138
+ track_options: {
139
+ dimension28: 1,
140
+ dimension29: 'dimension29Href'
141
+ }
142
+ }
143
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
144
+ image_alt: "some meaningful alt text please"
145
+ heading_text: "A link with tracking"
146
+ extra_links: [
147
+ {
148
+ text: "Another link with tracking",
149
+ href: "/1",
150
+ data_attributes: {
151
+ track_category: 'extra_category',
152
+ track_action: 2.1,
153
+ track_label: 'extra_label',
154
+ track_options: {
155
+ dimension28: 1,
156
+ dimension29: 'dimension29Extra'
157
+ }
158
+ }
159
+ }
160
+ ]
@@ -59,5 +59,5 @@ examples:
59
59
  </h1>
60
60
  </div>
61
61
  <p class="gem-c-lead-paragraph gem-c-lead-paragraph--inverse">
62
- Schools and academies, further and higher education, apprenticeships and other skills training, student funding, early&nbsp;years.
62
+ Schools and academies, further and higher education, apprenticeships and other skills training, student funding, early years.
63
63
  </p>
@@ -14,6 +14,16 @@ examples:
14
14
  base_path: "/foo"
15
15
  details: {}
16
16
  schema: :article
17
+
18
+ with_description:
19
+ data:
20
+ content_item:
21
+ title: "A title"
22
+ base_path: "/foo"
23
+ details: {}
24
+ schema: :article
25
+ description: "Some manually set description of the page"
26
+
17
27
  with_canonical_url:
18
28
  data:
19
29
  content_item:
@@ -22,7 +32,6 @@ examples:
22
32
  details: {}
23
33
  schema: :article
24
34
  canonical_url: "https://www.gov.uk/foreign-travel-advice/andorra/health"
25
-
26
35
  with_body:
27
36
  data:
28
37
  content_item:
@@ -31,3 +40,10 @@ examples:
31
40
  details: {}
32
41
  schema: :article
33
42
  body: "Some other body"
43
+ person_schema:
44
+ data:
45
+ content_item:
46
+ title: "A. Person"
47
+ base_path: "/foo"
48
+ details: {}
49
+ schema: :person
@@ -0,0 +1,27 @@
1
+ name: Notice
2
+ description: A notice to convey and highlight information
3
+ body: |
4
+ The notice component replaces the notice and withdrawal notice patterns on GOV.UK.
5
+
6
+ The component accepts either a simple string description_text parameter that it wraps in a paragraph, or a description_govspeak parameter that is rendered through govspeak for more complex HTML layout.
7
+ accessibility_criteria: |
8
+ The notice must:
9
+
10
+ - have a border colour contrast ratio of more than 4.5:1 with its background to be visually distinct.
11
+ - always render headings with associated description content, so there are no isolated heading elements inside the component
12
+ examples:
13
+ default:
14
+ data:
15
+ title: 'Statistics release cancelled'
16
+ with_description_text:
17
+ data:
18
+ title: 'Statistics release cancelled'
19
+ description_text: 'Duplicate, added in error'
20
+ with_description_govspeak:
21
+ data:
22
+ title: 'Statistics release update'
23
+ description_govspeak: '<p>The Oil &amp; Gas Authority launched a new website on 3 October 2016 to reflect its new status as a government company.</p><p>This formalises the transfer of the Secretary of State’s regulatory powers in respect of oil and gas to the OGA, and grants it new powers. This website will no longer be updated. Visitors should refer to <a rel="external" href="https://www.ogauthority.co.uk/news-publications/announcements/2015/establishment-of-the-oil-and-gas-authority-1/">www.ogauthority.co.uk</a></p>'
24
+ with_markup_in_the_title:
25
+ description: In some circumstances it may be necessary to include simple markup in the title, such as a link. Note that this will be wrapped in a H2 tag if there is no description included, so be sure that any markup inserted is valid inside that tag (e.g. another heading tag inside a H2 would be invalid).
26
+ data:
27
+ title: 'Advisory Committee on Novel Foods and Processes has a <a href="http://www.food.gov.uk/acnfp">separate website</a>'
@@ -1,11 +1,7 @@
1
1
  name: Share links
2
- description: Links to share the current page on Facebook or Twitter
2
+ description: Social media links for linking to or sharing the current page on social media.
3
3
  body: |
4
- Pass complete share URLs to the component. The component will not process a URL into a share link itself.
5
-
6
- Use only with content that benefits from being shared, for example a consultation.
7
-
8
- The component will track interactions with the share links to Google Analytics using [Social Interactions](https://developers.google.com/analytics/devguides/collection/analyticsjs/social-interactions)
4
+ The component will not process a URL into a share link itself. Pass complete share URLs to the component.
9
5
 
10
6
  Real world examples:
11
7
 
@@ -20,19 +16,124 @@ shared_accessibility_criteria:
20
16
  examples:
21
17
  default:
22
18
  data:
23
- facebook_href: '/facebook-link'
24
- twitter_href: '/twitter-link'
25
- with_custom_text:
26
- data:
27
- title: 'Share this news article'
28
- facebook_href: '/facebook-share-link'
29
- twitter_href: '/twitter-share-link'
30
- with_only_one_link_provided:
31
- data:
32
- facebook_href: '/only-facebook-link'
19
+ links: [
20
+ {
21
+ href: '/facebook-share-link',
22
+ text: 'Facebook',
23
+ icon: 'facebook'
24
+ },
25
+ {
26
+ href: '/twitter-share-link',
27
+ text: 'Twitter',
28
+ icon: 'twitter'
29
+ },
30
+ ]
33
31
  right_to_left:
34
32
  data:
35
- facebook_href: '/facebook-link'
36
- twitter_href: '/twitter-link'
33
+ links: [
34
+ {
35
+ href: '/facebook-share-link',
36
+ text: 'Facebook',
37
+ icon: 'facebook'
38
+ },
39
+ {
40
+ href: '/twitter-share-link',
41
+ text: 'Twitter',
42
+ icon: 'twitter'
43
+ },
44
+ ]
37
45
  context:
38
46
  right_to_left: true
47
+ track_as_sharing_links:
48
+ description: Where the component is used to allow users to share content on social media, tracking can be added that uses [Social Interactions](https://developers.google.com/analytics/devguides/collection/analyticsjs/social-interactions). If this option is not included, it is assumed the component is simply linking to social media pages and the extra options are omitted from the tracking call.
49
+ data:
50
+ track_as_sharing: true
51
+ links: [
52
+ {
53
+ href: 'share',
54
+ text: 'Share on Facebook',
55
+ icon: 'facebook'
56
+ }
57
+ ]
58
+ with_title:
59
+ data:
60
+ title: 'Share this page'
61
+ links: [
62
+ {
63
+ href: 'share',
64
+ text: 'Share on Facebook',
65
+ icon: 'facebook'
66
+ }
67
+ ]
68
+ with_branding:
69
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
70
+ data:
71
+ brand: 'attorney-generals-office'
72
+ links: [
73
+ {
74
+ href: 'share',
75
+ text: 'Follow the Attorney General on Twitter',
76
+ icon: 'twitter'
77
+ }
78
+ ]
79
+ stack_vertically:
80
+ data:
81
+ stacked: true
82
+ links: [
83
+ {
84
+ href: '/facebook-share-link',
85
+ text: 'Facebook',
86
+ icon: 'facebook'
87
+ },
88
+ {
89
+ href: '/twitter-share-link',
90
+ text: 'Twitter',
91
+ icon: 'twitter'
92
+ },
93
+ ]
94
+ with_all_icons:
95
+ data:
96
+ stacked: true
97
+ brand: 'hm-treasury'
98
+ links: [
99
+ {
100
+ href: '/facebook-share-link',
101
+ text: 'Facebook',
102
+ icon: 'facebook'
103
+ },
104
+ {
105
+ href: '/twitter-share-link',
106
+ text: 'Twitter',
107
+ icon: 'twitter'
108
+ },
109
+ {
110
+ href: '/email-share-link',
111
+ text: 'Email',
112
+ icon: 'email'
113
+ },
114
+ {
115
+ href: '/flickr-share-link',
116
+ text: 'Flickr',
117
+ icon: 'flickr'
118
+ },
119
+ {
120
+ href: '/instagram-share-link',
121
+ text: 'Instagram',
122
+ icon: 'instagram'
123
+ },
124
+ {
125
+ href: '/linkedin-share-link',
126
+ text: 'Linkedin',
127
+ icon: 'linkedin'
128
+ },
129
+ {
130
+ href: '/youtube-share-link',
131
+ text: 'YouTube',
132
+ icon: 'youtube'
133
+ },
134
+ {
135
+ href: '/other-share-link',
136
+ text: 'Anything else',
137
+ icon: 'other'
138
+ },
139
+ ]