govuk_tech_docs 4.0.0 → 4.1.1

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: 4dc850d9644bdfb68d0604fb1a6b9710e677d10efcb3ad7107b4ac592924931d
4
- data.tar.gz: c6cf243d37b9e353ce4400dc2b9a5b521753ff3a56338fcb406f063205a01b55
3
+ metadata.gz: d3e848b2f3145907e130147476ebd629df69ac468e69348e9de3c1362c0263b6
4
+ data.tar.gz: 5afa9c3b6a40237ad08c18c255d4fb381baff1911b981ae7136e23f94e2a52a3
5
5
  SHA512:
6
- metadata.gz: 9b270f50021512617508ed2204b67b87a5b329baf833ea6c3446eee3918d889c1553c2854faf0fcf250183c1b75d59125c7f325497215a5fd3ebd4670b0acdc6
7
- data.tar.gz: 257a1b7a1d73f43ae716986ae98eea6bb8843eb06100a870691d6c3a0e7c26eecba849aef97d8b93c08a899724e8176384f0470b96c77b58b3c1bd8ff099cd2e
6
+ metadata.gz: e748131fd5124335034686063131b98309bb83c7e709b633a6e21fee145db1f44f173ed0b7f063036993f580192b0ad532fca19dba245d9f31579b9fa469a2f2
7
+ data.tar.gz: b182f9398a855d96927c3a0c103e353c271a348d3d5eb8f35a0329d541b23b8b1b655b44aff6648987939dc2b0707012be443a30396c78ca576024ae1c2ce677
data/CHANGELOG.md CHANGED
@@ -1,4 +1,14 @@
1
- ## Unreleased
1
+ ## 4.1.1
2
+
3
+ ## Fixes
4
+
5
+ - [Disable focus outline on navigation link](https://github.com/alphagov/tech-docs-gem/pull/379)
6
+ - [Warning text extension fix for govuk-frontend v5.7.1](https://github.com/alphagov/tech-docs-gem/pull/378)
7
+
8
+ ## 4.1.0
9
+
10
+ - [Fix missing manifest.json from govuk-frontend](https://github.com/alphagov/tech-docs-gem/pull/376)
11
+ - [Stable soft for left navigation](https://github.com/alphagov/tech-docs-gem/pull/374)
2
12
 
3
13
  ## 4.0.0
4
14
 
@@ -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}"]
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"]
29
29
 
30
30
  spec.files = files_in_git + govuk_frontend_assets
31
31
 
@@ -43,6 +43,7 @@
43
43
 
44
44
  a:focus {
45
45
  text-decoration: none;
46
+ outline: none;
46
47
 
47
48
  span {
48
49
  @include govuk-focused-text;
@@ -18,12 +18,27 @@ module GovukTechDocs
18
18
  output
19
19
  end
20
20
 
21
+ # Items with a weight appear first, in weight order
22
+ # if items have equal weight, they stay in the order they appeared (stable sort)
23
+ # Items without a weight appear after, sorted stably in the order that they are
24
+ # present in the resource list
25
+ def sort_resources_stably(resources)
26
+ resources
27
+ .each.with_index
28
+ .sort_by { |r, index| [r.data.weight ? 0 : 1, r.data.weight || 0, index] }
29
+ .map(&:first)
30
+ .to_a
31
+ end
32
+
33
+ def select_top_level_html_files(resources)
34
+ resources
35
+ .select { |r| r.path.end_with?(".html") && (r.parent.nil? || r.parent.url == "/") }
36
+ end
37
+
21
38
  def multi_page_table_of_contents(resources, current_page, config, current_page_html = nil)
22
- # Only parse top level html files
23
- # Sorted by weight frontmatter
24
- resources = resources
25
- .select { |r| r.path.end_with?(".html") && (r.parent.nil? || r.parent.url == "/") }
26
- .sort_by { |r| [r.data.weight ? 0 : 1, r.data.weight || 0] }
39
+ resources = sort_resources_stably(
40
+ select_top_level_html_files(resources),
41
+ )
27
42
 
28
43
  render_page_tree(resources, current_page, config, current_page_html)
29
44
  end
@@ -40,9 +55,7 @@ module GovukTechDocs
40
55
  end
41
56
 
42
57
  def render_page_tree(resources, current_page, config, current_page_html)
43
- # Sort by weight frontmatter
44
- resources = resources
45
- .sort_by { |r| [r.data.weight ? 0 : 1, r.data.weight || 0] }
58
+ resources = sort_resources_stably(resources)
46
59
 
47
60
  output = "<ul>\n"
48
61
  resources.each do |resource|
@@ -1,3 +1,3 @@
1
1
  module GovukTechDocs
2
- VERSION = "4.0.0".freeze
2
+ VERSION = "4.1.1".freeze
3
3
  end
@@ -10,7 +10,7 @@ module GovukTechDocs
10
10
  <div class="govuk-warning-text">
11
11
  <span class="govuk-warning-text__icon" aria-hidden="true">!</span>
12
12
  <strong class="govuk-warning-text__text">
13
- <span class="govuk-warning-text__assistive">Warning</span>
13
+ <span class="govuk-visually-hidden">Warning</span>
14
14
  #{text}
15
15
  </strong>
16
16
  </div>
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_tech_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Government Digital Service
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-23 00:00:00.000000000 Z
11
+ date: 2024-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autoprefixer-rails
@@ -509,6 +509,7 @@ files:
509
509
  - node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png
510
510
  - node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-mask.svg
511
511
  - node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png
512
+ - node_modules/govuk-frontend/dist/govuk/assets/manifest.json
512
513
  - node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs
513
514
  - node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs
514
515
  - node_modules/govuk-frontend/dist/govuk/common/index.mjs
@@ -717,7 +718,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
717
718
  - !ruby/object:Gem::Version
718
719
  version: '0'
719
720
  requirements: []
720
- rubygems_version: 3.5.16
721
+ rubygems_version: 3.5.22
721
722
  signing_key:
722
723
  specification_version: 4
723
724
  summary: Gem to distribute the GOV.UK Tech Docs Template