govuk_tech_docs 4.1.1 → 4.2.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 +4 -4
- data/CHANGELOG.md +16 -0
- data/Rakefile +10 -2
- data/govuk_tech_docs.gemspec +1 -1
- data/lib/assets/javascripts/_modules/table-of-contents.js +12 -8
- data/lib/assets/stylesheets/modules/_app-pane.scss +7 -0
- data/lib/govuk_tech_docs/meta_tags.rb +5 -1
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/source/layouts/core.erb +11 -6
- data/package-lock.json +2795 -58
- data/package.json +8 -2
- metadata +17 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78c114ef827fc1b01f302f750a3191551d57b58f5beb85486bb4d9fd93a215da
|
4
|
+
data.tar.gz: ae107761242ea52f0d4104316931d748ecc5b9654a59759d5fa121d207c2160d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c2d338a2b5c96c3cc1a711f5875a60f576e1a4490102c7a543b040686e7b885aa048a4946067a1e787f4ae78dea3c6b678442f5f3652e5545f236d14f331aa8
|
7
|
+
data.tar.gz: c6e5b6de36c342c566d70bbb9fbafe9c9af0e0d2eae1704f3c90e7626d90e1580da6201c5c683643f70edef578f44067c8806f036375f3ee6c0d06cee54df967
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
## 4.2.0
|
2
|
+
|
3
|
+
## New features
|
4
|
+
|
5
|
+
- [Allow non-GOV.UK favicon and opengraph assets](https://github.com/alphagov/tech-docs-gem/pull/387)
|
6
|
+
|
7
|
+
To use a non-crown assets, you need to
|
8
|
+
- add `favicon.ico`, `favicon.svg` and `opengraph-image.png` to your `source/images` folder.
|
9
|
+
- set `show_govuk_logo: false`
|
10
|
+
|
11
|
+
## 4.1.2
|
12
|
+
|
13
|
+
## Fixes
|
14
|
+
|
15
|
+
- [Fix focus issues with table of contents and main content pane](https://github.com/alphagov/tech-docs-gem/pull/381)
|
16
|
+
|
1
17
|
## 4.1.1
|
2
18
|
|
3
19
|
## Fixes
|
data/Rakefile
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rspec/core/rake_task"
|
3
|
-
require "jasmine"
|
4
3
|
|
5
4
|
RSpec::Core::RakeTask.new(:spec)
|
6
5
|
|
7
|
-
|
6
|
+
namespace :jasmine do
|
7
|
+
desc "Test JavaScript with headless browser"
|
8
|
+
task :ci do
|
9
|
+
sh "npm test"
|
10
|
+
end
|
11
|
+
desc "Test JavaScript in browser"
|
12
|
+
task :server do
|
13
|
+
sh "npm run test-server"
|
14
|
+
end
|
15
|
+
end
|
8
16
|
|
9
17
|
desc "Lint Ruby and JavaScript"
|
10
18
|
task :lint do
|
data/govuk_tech_docs.gemspec
CHANGED
@@ -39,6 +39,7 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency "base64" # TODO: remove once middleman-sprockets declares this itself.
|
40
40
|
spec.add_dependency "bigdecimal" # TODO: remove once activesupport declares this itself.
|
41
41
|
spec.add_dependency "chronic", "~> 0.10.2"
|
42
|
+
spec.add_dependency "concurrent-ruby", "1.3.4" # 1.3.5 introduced a change that breaks activesupport, and so middleman
|
42
43
|
spec.add_dependency "csv" # TODO: remove once tilt declares this itself.
|
43
44
|
spec.add_dependency "haml", "~> 6.0"
|
44
45
|
spec.add_dependency "middleman", "~> 4.0"
|
@@ -57,7 +58,6 @@ Gem::Specification.new do |spec|
|
|
57
58
|
|
58
59
|
spec.add_development_dependency "byebug"
|
59
60
|
spec.add_development_dependency "capybara", "~> 3.32"
|
60
|
-
spec.add_development_dependency "jasmine", "~> 3.5"
|
61
61
|
spec.add_development_dependency "rake", "~> 13.0"
|
62
62
|
spec.add_development_dependency "rspec", "~> 3.9"
|
63
63
|
spec.add_development_dependency "rubocop-govuk", "~> 4.10"
|
@@ -104,7 +104,6 @@
|
|
104
104
|
function openNavigation () {
|
105
105
|
$html.addClass('toc-open')
|
106
106
|
|
107
|
-
toggleBackgroundVisiblity(false)
|
108
107
|
updateAriaAttributes()
|
109
108
|
$toc.focus()
|
110
109
|
}
|
@@ -112,25 +111,30 @@
|
|
112
111
|
function closeNavigation () {
|
113
112
|
$html.removeClass('toc-open')
|
114
113
|
|
115
|
-
toggleBackgroundVisiblity(true)
|
116
114
|
updateAriaAttributes()
|
117
|
-
|
118
|
-
|
119
|
-
function toggleBackgroundVisiblity (visibility) {
|
120
|
-
$('.toc-open-disabled').attr('aria-hidden', visibility ? '' : 'true')
|
115
|
+
$openButton.focus()
|
121
116
|
}
|
122
117
|
|
123
118
|
function updateAriaAttributes () {
|
124
119
|
var tocIsVisible = $toc.is(':visible')
|
125
|
-
var
|
120
|
+
var tocIsDialog = $openButton.is(':visible')
|
126
121
|
|
127
122
|
$($openButton).add($closeButton)
|
128
123
|
.attr('aria-expanded', tocIsVisible ? 'true' : 'false')
|
129
124
|
|
130
125
|
$toc.attr({
|
131
126
|
'aria-hidden': tocIsVisible ? 'false' : 'true',
|
132
|
-
role:
|
127
|
+
role: tocIsDialog ? 'dialog' : null
|
133
128
|
})
|
129
|
+
|
130
|
+
$('.app-pane__content').attr('aria-hidden', (tocIsDialog && tocIsVisible) ? 'true' : 'false')
|
131
|
+
|
132
|
+
// only make main content pane focusable if it scrolls independently of the toc
|
133
|
+
if (!tocIsDialog) {
|
134
|
+
$('.app-pane__content').attr('tabindex', '0')
|
135
|
+
} else {
|
136
|
+
$('.app-pane__content').removeAttr('tabindex')
|
137
|
+
}
|
134
138
|
}
|
135
139
|
|
136
140
|
function preventingScrolling (callback) {
|
@@ -48,7 +48,11 @@ module GovukTechDocs
|
|
48
48
|
attr_reader :config, :current_page
|
49
49
|
|
50
50
|
def page_image
|
51
|
-
|
51
|
+
if config[:tech_docs][:show_govuk_logo]
|
52
|
+
"#{host}/assets/govuk/assets/images/govuk-opengraph-image.png"
|
53
|
+
else
|
54
|
+
"#{host}/images/opengraph-image.png"
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
def site_name
|
data/lib/source/layouts/core.erb
CHANGED
@@ -10,11 +10,16 @@
|
|
10
10
|
<%= stylesheet_link_tag :manifest %>
|
11
11
|
|
12
12
|
<link rel="canonical" href="<%= meta_tags.canonical_url %>">
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
<% if config[:tech_docs][:show_govuk_logo] %>
|
14
|
+
<link rel="icon" sizes="48x48" href="/assets/govuk/assets/images/favicon.ico">
|
15
|
+
<link rel="icon" sizes="any" href="/assets/govuk/assets/images/favicon.svg" type="image/svg+xml">
|
16
|
+
<link rel="mask-icon" href="/assets/govuk/assets/images/govuk-icon-mask.svg" color="#0b0c0c">
|
17
|
+
<link rel="apple-touch-icon" href="/assets/govuk/assets/images/govuk-icon-180.png">
|
18
|
+
<link rel="manifest" href="/assets/govuk/assets/manifest.json">
|
19
|
+
<% else %>
|
20
|
+
<link rel="icon" sizes="48x48" href="/images/favicon.ico">
|
21
|
+
<link rel="icon" sizes="any" href="/images/favicon.svg" type="image/svg+xml">
|
22
|
+
<% end %>
|
18
23
|
|
19
24
|
<% meta_tags.tags.each do |name, content| %>
|
20
25
|
<%= tag :meta, name: name, content: content %>
|
@@ -58,7 +63,7 @@
|
|
58
63
|
</div>
|
59
64
|
<% end %>
|
60
65
|
|
61
|
-
<div class="app-pane__content toc-open-disabled" aria-label="Content"
|
66
|
+
<div class="app-pane__content toc-open-disabled" aria-label="Content">
|
62
67
|
<main id="content" class="technical-documentation" data-module="anchored-headings">
|
63
68
|
<%= yield %>
|
64
69
|
<%= partial "layouts/page_review" %>
|