govuk_tech_docs 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 789b6424fcd0b3fdd7caa228cc6f240d49005c1166d0e2e0a5038e6a103df953
4
- data.tar.gz: 3775fc854723c90b289f1ac73e875d6accc4c9e945f0932f315b1e13d001d945
3
+ metadata.gz: 6dc363343ebff60652f16de327d4bc64c8c7d043ca22de573699c62fd177e354
4
+ data.tar.gz: ff3c5f3505a3592592c088d0e652279eaba401a886fb76bf100e29e266b19d64
5
5
  SHA512:
6
- metadata.gz: 99b729b98873333ba4c440ab615268dd2cfac72277ffdab0f16585800fed6d69dcecacdd63b94feca89b827ce48e2433e60b568131a776ba1e3b8e405ddf12c6
7
- data.tar.gz: 7e3e5304f2ed60b69f26cd7a6f17a7335a0aeae639bb9cbd1f8ee2b944f525eb60cbbcac739beb96804b6b5615a14663ca0aa9875211117563aa2de78ccf423f
6
+ metadata.gz: 68280ebd9b54a3b89962caa936fdda0754459284ac714e5399af7d785f997a52cf4c65c71f0f8fc3dd402a03c38705a8d3b4f0a859ce5590492be3be8c37265b
7
+ data.tar.gz: bb17570b442df5edffacbb28f4fa5837b8066b63a30cec06ba6952f0bf2f50ea6bb0be536828c08bce108275d4ecd964e0ab768ba1a420d456bd0d68bc83dd78
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  ## Unreleased
2
2
 
3
+ ### New Features
4
+
5
+ - [Adds support for GA4 as a separate tracking parameter from Universal Analytics](https://github.com/alphagov/tech-docs-gem/pull/350)
6
+
7
+ NB: [Universal Analytics is now gone](https://support.google.com/analytics/answer/11583528?hl=en) so anyone still using the older approach is likely facing broken analytics, or has developed a workaround.
8
+ We'll return at a later date with a major breaking change that deprecates UA code.
9
+
10
+ ## 5.1.0
11
+
12
+ ### New features
13
+
14
+ - [Add GA4 support](https://github.com/alphagov/tech-docs-gem/pull/350)
15
+
16
+ ### Fixes
17
+
18
+ - [Fix syntax highlighting by pinning middleman-syntax to v3.6+](https://github.com/alphagov/tech-docs-gem/pull/427)
19
+
20
+ ## 5.0.2
21
+
22
+ ### Fixes
23
+
24
+ - [Fix copy of manifest.json into build](https://github.com/alphagov/tech-docs-gem/pull/423)
25
+
3
26
  ## 5.0.1
4
27
 
5
28
  ### Fixes
@@ -54,7 +77,7 @@ To use the service_link at the start of the path to the favicon images, you need
54
77
 
55
78
  - [Allow non-GOV.UK favicon and opengraph assets](https://github.com/alphagov/tech-docs-gem/pull/387)
56
79
 
57
- To use a non-crown assets, you need to
80
+ To use a non-crown assets, you need to
58
81
  - add `favicon.ico`, `favicon.svg` and `opengraph-image.png` to your `source/images` folder.
59
82
  - set `show_govuk_logo: false`
60
83
 
@@ -152,22 +175,22 @@ You can now [configure your Tech Docs Template (TDT) to build your documentation
152
175
 
153
176
  Thanks [@eddgrant](https://github.com/eddgrant) for contributing this feature and the associated fixes.
154
177
 
155
- This change was introduced in [pull request #291: Support sites deployed on paths other than "/" (by generating relative links)](https://github.com/alphagov/tech-docs-gem/pull/291).
178
+ This change was introduced in [pull request #291: Support sites deployed on paths other than "/" (by generating relative links)](https://github.com/alphagov/tech-docs-gem/pull/291).
156
179
 
157
180
  ## 3.1.0
158
181
 
159
182
  ### New features
160
183
 
161
- There are some steps you should follow as the Technical Documentation Template (TDT) now uses GOV.UK Frontend 4.0.0.
184
+ There are some steps you should follow as the Technical Documentation Template (TDT) now uses GOV.UK Frontend 4.0.0.
162
185
 
163
186
  1. Update your documentation site to use the latest template version. You can [follow the TDT guidance on using the latest template version](https://tdt-documentation.london.cloudapps.digital/maintain_project/use_latest_template/).
164
- 2. Check your documentation site displays correctly. If your site does not display correctly, you can refer to the [GOV.UK Frontend 4.0.0 release note](https://github.com/alphagov/govuk-frontend/releases/tag/v4.0.0) for more information.
187
+ 2. Check your documentation site displays correctly. If your site does not display correctly, you can refer to the [GOV.UK Frontend 4.0.0 release note](https://github.com/alphagov/govuk-frontend/releases/tag/v4.0.0) for more information.
165
188
 
166
189
  ## 3.0.1
167
190
 
168
191
  ### Fixes
169
192
 
170
- We’ve made the following fixes to the tech docs gem in [pull request #281: Don't break TOC when OpenAPI description includes headers](https://github.com/alphagov/tech-docs-gem/pull/281):
193
+ We’ve made the following fixes to the tech docs gem in [pull request #281: Don't break TOC when OpenAPI description includes headers](https://github.com/alphagov/tech-docs-gem/pull/281):
171
194
 
172
195
  * we now render OpenAPI Markdown with the same Markdown renderer as other documents
173
196
  * table of contents (TOC) uses `TechDocsHTMLRenderer` to render the headings with IDs
@@ -19,7 +19,10 @@ footer_links:
19
19
  Accessibility: /hidden-page.html
20
20
  Hidden Page: /hidden-page.html
21
21
 
22
- # Tracking ID from Google Analytics (e.g. UA-XXXX-Y)
22
+ # Tracking ID (if using GA4 e.g G-XXXXXX)
23
+ ga4_tracking_id:
24
+
25
+ # Tracking ID from Google Universal Analytics (e.g. UA-XXXX-Y)
23
26
  ga_tracking_id:
24
27
 
25
28
  # Enable multipage navigation in the sidebar
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  files_in_git = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
26
 
27
27
  # Include assets from GOV.UK Frontend library in the distributed gem
28
- govuk_frontend_assets = Dir["node_modules/govuk-frontend/**/*.{scss,js,mjs,woff,woff2,png,svg,ico}", "node_modules/govuk-frontend/dist/govuk/assets/manifest.json"]
28
+ govuk_frontend_assets = Dir["node_modules/govuk-frontend/**/*.{scss,js,mjs,woff,woff2,png,svg,ico}", "node_modules/govuk-frontend/dist/govuk/assets/**/*.json"]
29
29
 
30
30
  spec.files = files_in_git + govuk_frontend_assets
31
31
 
@@ -48,7 +48,7 @@ Gem::Specification.new do |spec|
48
48
  spec.add_dependency "middleman-livereload"
49
49
  spec.add_dependency "middleman-search-gds"
50
50
  spec.add_dependency "middleman-sprockets", "~> 4.0.0"
51
- spec.add_dependency "middleman-syntax", "~> 3.4"
51
+ spec.add_dependency "middleman-syntax", "~> 3.6"
52
52
  spec.add_dependency "mutex_m" # TODO: remove once activesupport declares this itself.
53
53
  spec.add_dependency "nokogiri"
54
54
  spec.add_dependency "openapi3_parser", "~> 0.9.0"
@@ -1,3 +1,3 @@
1
1
  module GovukTechDocs
2
- VERSION = "5.0.1".freeze
2
+ VERSION = "5.1.0".freeze
3
3
  end
@@ -0,0 +1,10 @@
1
+ <% if config[:tech_docs][:ga4_tracking_id].is_a?(String) && !config[:tech_docs][:ga4_tracking_id].empty? %>
2
+ <!-- Google tag (gtag.js) -->
3
+ <script async src="https://www.googletagmanager.com/gtag/js?id=<%= config[:tech_docs][:ga4_tracking_id]%>"></script>
4
+ <script>
5
+ window.dataLayer = window.dataLayer || [];
6
+ function gtag(){dataLayer.push(arguments);}
7
+ gtag('js', new Date());
8
+ gtag('config', '<%= config[:tech_docs][:ga4_tracking_id] %>');
9
+ </script>
10
+ <% end %>
@@ -1,6 +1,8 @@
1
1
  <!doctype html>
2
2
  <html lang="en" class="govuk-template <%= config[:tech_docs][:show_govuk_logo] ? 'govuk-template--rebranded ' : '' %>no-js">
3
3
  <head>
4
+ <%= partial 'layouts/analytics_head' %>
5
+
4
6
  <meta content="IE=edge" http-equiv="X-UA-Compatible">
5
7
  <meta charset="utf-8">
6
8
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
@@ -0,0 +1,39 @@
1
+ {
2
+ "icons": [
3
+ {
4
+ "src": "images/favicon.ico",
5
+ "type": "image/x-icon",
6
+ "sizes": "48x48"
7
+ },
8
+ {
9
+ "src": "images/favicon.svg",
10
+ "type": "image/svg+xml",
11
+ "sizes": "150x150",
12
+ "purpose": "any"
13
+ },
14
+ {
15
+ "src": "images/govuk-icon-180.png",
16
+ "type": "image/png",
17
+ "sizes": "180x180",
18
+ "purpose": "maskable"
19
+ },
20
+ {
21
+ "src": "images/govuk-icon-192.png",
22
+ "type": "image/png",
23
+ "sizes": "192x192",
24
+ "purpose": "maskable"
25
+ },
26
+ {
27
+ "src": "images/govuk-icon-512.png",
28
+ "type": "image/png",
29
+ "sizes": "512x512",
30
+ "purpose": "maskable"
31
+ },
32
+ {
33
+ "src": "images/govuk-icon-mask.svg",
34
+ "type": "image/svg+xml",
35
+ "sizes": "150x150",
36
+ "purpose": "monochrome"
37
+ }
38
+ ]
39
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_tech_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Government Digital Service
@@ -197,14 +197,14 @@ dependencies:
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: '3.4'
200
+ version: '3.6'
201
201
  type: :runtime
202
202
  prerelease: false
203
203
  version_requirements: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: '3.4'
207
+ version: '3.6'
208
208
  - !ruby/object:Gem::Dependency
209
209
  name: mutex_m
210
210
  requirement: !ruby/object:Gem::Requirement
@@ -481,6 +481,7 @@ files:
481
481
  - lib/source/images/search-button.png
482
482
  - lib/source/images/search-result-caret.svg
483
483
  - lib/source/layouts/_analytics.erb
484
+ - lib/source/layouts/_analytics_head.erb
484
485
  - lib/source/layouts/_footer.erb
485
486
  - lib/source/layouts/_header.erb
486
487
  - lib/source/layouts/_page_review.erb
@@ -518,6 +519,7 @@ files:
518
519
  - node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png
519
520
  - node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg
520
521
  - node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png
522
+ - node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json
521
523
  - node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs
522
524
  - node_modules/govuk-frontend/dist/govuk/common/configuration.mjs
523
525
  - node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs
@@ -728,7 +730,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
728
730
  - !ruby/object:Gem::Version
729
731
  version: '0'
730
732
  requirements: []
731
- rubygems_version: 3.6.7
733
+ rubygems_version: 3.6.9
732
734
  specification_version: 4
733
735
  summary: Gem to distribute the GOV.UK Tech Docs Template
734
736
  test_files: []