govuk_tech_docs 6.4.1.0 → 6.5.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: 8f326d15a8bd80fdec03049e06969fa49df12a72e1379c0638c32b6438553491
4
- data.tar.gz: a51886d4182c8938ae188075568fd92028bf1899b410d0caaff864612ec17763
3
+ metadata.gz: 741a7042683c573724cdbab2c958d98306c55b0e81af89b9054952355a4a9268
4
+ data.tar.gz: a8a1cb466cdde9545ee2c8bdf46eb6c1e64d6a550f20073b6e9ad542d2aea189
5
5
  SHA512:
6
- metadata.gz: 48c680742a7eb673015b3d4c0d0e84d11e2f3bd220ba99a50aace843c110d8eb756ec3ed599242e9290e2f9ab407090115961f685407d44edd6545b4186f2d87
7
- data.tar.gz: 223a5bf9bfa71d7977a83d5fc1c8f45d3aec88e0f7270688c0d03d7f6eb1952aa540a2424fe938992b8a0c455c52a37b3d437500fdec3deffb4a2ecc049b4b8a
6
+ metadata.gz: 2c494c002dd3830aee443bb3caee5cbd345cb6fbc3f7439e3bf7aac0a1ee5270ff67673e1930038a498f9158245bd2de38332d8e4d05bdc4ed75ca64291e432c
7
+ data.tar.gz: ee4d71a1692537a142a57fc65b579fb44d65799114509ff8bfc7d1370c8a1849e2201043d06af45089df6ae60afc60223cc1b5022f77d4f9f7351e523153bb33
@@ -23,7 +23,7 @@ jobs:
23
23
  with:
24
24
  node-version-file: 'documentation/.nvmrc'
25
25
  - name: Setup Ruby
26
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
26
+ uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
27
27
  with:
28
28
  bundler-cache: true
29
29
  working-directory: documentation
@@ -17,15 +17,16 @@ jobs:
17
17
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18
18
  with:
19
19
  show-progress: false
20
+ fetch-depth: 2
20
21
 
21
- - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
22
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
22
23
  with:
23
24
  ruby-version: '3'
24
25
 
25
26
  - name: Documentation updated
26
27
  id: documentation_updated
27
28
  run: |
28
- if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^documentation/'; then
29
+ if git diff --name-only HEAD^ HEAD | grep -q '^documentation/'; then
29
30
  echo "documentation-updated=true" >> $GITHUB_OUTPUT
30
31
  else
31
32
  echo "documentation-updated=false" >> $GITHUB_OUTPUT
@@ -17,7 +17,7 @@ jobs:
17
17
  with:
18
18
  show-progress: false
19
19
 
20
- - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
20
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
21
21
  with:
22
22
  ruby-version: '3'
23
23
 
@@ -48,7 +48,7 @@ jobs:
48
48
 
49
49
  publish-github-pages:
50
50
  needs: check-documentation-updates
51
- if: github.event_name == 'push' && needs.check-documentation-updates.outputs.documentation-updated == 'true'
51
+ if: always() && github.event_name == 'push' && needs.check-documentation-updates.result == 'success' && needs.check-documentation-updates.outputs.documentation-updated == 'true'
52
52
  uses: ./.github/workflows/publish-github-pages.yaml
53
53
  permissions:
54
54
  contents: read
@@ -35,20 +35,11 @@ jobs:
35
35
  node-version-file: '.nvmrc'
36
36
  cache: 'npm'
37
37
 
38
- - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
38
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
39
39
  with:
40
40
  ruby-version: '3'
41
41
  bundler-cache: true
42
42
 
43
- - name: Verify Secret Presence
44
- run: |
45
- if [ -z "${{ secrets.RUBYGEMS_API_KEY }}" ]; then
46
- echo "Error: Secret is empty or missing from this context!"
47
- exit 1
48
- else
49
- echo "Secret is populated."
50
- fi
51
-
52
43
  - name: Publish
53
44
  env:
54
45
  RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
@@ -1,7 +1,7 @@
1
1
  name: Publish GitHub pages
2
2
  on:
3
3
  workflow_call:
4
-
4
+ workflow_dispatch:
5
5
 
6
6
  permissions:
7
7
  contents: read
@@ -15,7 +15,7 @@ jobs:
15
15
  uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
16
16
 
17
17
  - name: Setup Ruby
18
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b
18
+ uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8
19
19
  with:
20
20
  ruby-version: '3.3'
21
21
  bundler-cache: true
@@ -33,7 +33,7 @@ jobs:
33
33
  node-version-file: '.nvmrc'
34
34
  cache: 'npm'
35
35
 
36
- - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
36
+ - uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
37
37
  with:
38
38
  ruby-version: ${{ matrix.ruby }}
39
39
  bundler-cache: true
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  ## Unreleased changes
2
2
 
3
+ ## 6.5.0
4
+
5
+ ### Changed
6
+
7
+ - **potentially breaking**: `enable_govuk_components` has been removed from the config as these are now required for the header and footer. If you are using this value for custom code or templates you should address this before updating.
8
+ - added config settings:
9
+ - `product_name`
10
+ - `headerContainerClasses`
11
+ - `headerClasses`
12
+ - `navigationContainerClasses`
13
+ - `navigationClasses`
14
+
15
+ [Check the documentation](https://design-system.service.gov.uk/components/header/) to see if you should add this value into your site.
16
+
17
+ - updated header and footer layouts to use components
18
+
19
+ ### Deprecation warning
20
+
21
+ - `show_govuk_logo:` setting will be removed in v7.x.x in to be replaced by the generic header and custom logo settings
22
+ - `warning_text` custom extension will be removed in v7.x.x. This was [marked as deprecated on 1st June 2026](https://github.com/alphagov/tech-docs-gem/commit/304230ba9c49759471a9a8f2daa425e37f846364#diff-2a7ef696e418f6044e5b18ae22c9cff4cac18481ae6fd0c1360ef978087b6cc9R8-R9). You should now [use the GOV.UK warning text component](https://alphagov.github.io/tech-docs-gem/write_docs/content/#use-the-gov-uk-design-system).
23
+
24
+
25
+
3
26
  ## 6.4.1
4
27
 
5
28
  - Bugfix: [Issue 283](https://github.com/alphagov/tech-docs-gem/issues/283) - correctly read report issue url (backwards compatible)
data/README.md CHANGED
@@ -159,38 +159,26 @@ refer to this [list of possible fixes](#issue-with-ffi-on-osx-mohave).
159
159
  For more information on previewing your documentation locally, see
160
160
  the [Tech Docs template documentation on previewing your documentation](https://alphagov.github.io/tech-docs-gem/create_project/preview/#preview-your-documentation).
161
161
 
162
- ## Tests
163
162
 
164
- ### Ruby tests and linting
163
+ ## Linting
165
164
 
166
- You can run the Ruby test suite with the following command:
167
-
168
- ```shell
169
- bundle exec rake spec
170
- ```
165
+ You should run the linter before pushing any changes to GitHub to check for errors and correct formatting. You can run linter jobs for ruby by running `bundle exec rubocop`. If you would like the linter to try and automatically fix any errors use `bundle exec rubocop -a`.
171
166
 
172
- To test a specific file include the filepath after `rspec`.
167
+ You can lint javascript files with the command `npm run lint`. If only want to see the final result and not the full output, use `npm run lint --silent`.
173
168
 
174
- You can lint the ruby code with the command:
169
+ You can also use the `Rakefile` job to run both together by running `bundle exec rake lint`. See the [Rakefile](./Rakefile) for more detail.
175
170
 
176
- ```shell
177
- bundle exec rubocop
178
- ```
171
+ ### Ruby tests
179
172
 
180
- Rubocop can automatically fix some linting issues. If the above command has suggestions that you automatically fix them
181
- with:
173
+ You can run the Ruby test suite with the following command:
182
174
 
183
175
  ```shell
184
- bundle exec rubocop -a
176
+ bundle exec rake spec
185
177
  ```
186
178
 
187
- ### JavaScript tests and linting
179
+ To test a specific file, use Rake's `SPEC` variable and set it to your filepath or directory. For example `bundle exec rake spec SPEC=spec/govuk_tech_docs/meta_tags_spec.rb`
188
180
 
189
- Use this command to run the linting and tests for the JavaScript code:
190
-
191
- ```sh
192
- bundle exec rake
193
- ```
181
+ ### JavaScript tests
194
182
 
195
183
  The JavaScript tests use the [Jasmine test framework][jas].
196
184
 
@@ -3,14 +3,25 @@ host: https://alphagov.github.io/tech-docs-gem
3
3
 
4
4
  # Header-related options
5
5
  show_govuk_logo: false
6
+ product_name:
6
7
  service_name: Tech docs template
7
8
  service_link: https://alphagov.github.io/tech-docs-gem
8
9
  phase: Beta
9
10
 
10
- # Uncomment if you do not want to activate the GOV.UK Design System component extension
11
- enable_govuk_components: true
12
11
 
13
- # Links to show on right-hand-side of header
12
+ #These can be used to add custom classes to the GOV.UK header, footer and service navigation components. You can find more detail about these on the component documentation at:
13
+ #https://design-system.service.gov.uk/components/header/
14
+ #https://design-system.service.gov.uk/components/service-navigation/
15
+ #https://design-system.service.gov.uk/components/footer/
16
+
17
+ headerContainerClasses:
18
+ headerClasses:
19
+ navigationContainerClasses:
20
+ navigationClasses:
21
+ footerContainerClasses:
22
+ footerClasses:
23
+
24
+ # Links to show on service navigation below header
14
25
  header_links:
15
26
  Template: https://github.com/alphagov/tech-docs-template
16
27
  Ruby gem: https://github.com/alphagov/tech-docs-gem
@@ -16,13 +16,23 @@ When you create your documentation project, the template creates a `tech-docs.ym
16
16
  host:
17
17
 
18
18
  # Header-related options
19
+ product_name: GOV.UK Product
19
20
  show_govuk_logo: true
20
21
  service_name: My First Service
21
22
  service_link: https://www.larry-the-cat.service.gov.uk
22
23
  phase: Beta
23
24
 
24
- # Uncomment if you do not want to activate the GOV.UK Design System component extension
25
- # enable_govuk_components: false
25
+ #These can be used to add custom classes to the GOV.UK header, footer and service navigation components. You can find more detail about these on the component documentation at:
26
+ #https://design-system.service.gov.uk/components/header/
27
+ #https://design-system.service.gov.uk/components/service-navigation/
28
+ #https://design-system.service.gov.uk/components/footer/
29
+
30
+ headerContainerClasses:
31
+ headerClasses:
32
+ navigationContainerClasses:
33
+ navigationClasses:
34
+ footerContainerClasses:
35
+ footerClasses:
26
36
 
27
37
  # Links to show on right-hand-side of header
28
38
  header_links:
@@ -56,7 +66,7 @@ github_repo: alphagov/YOUR_REPO
56
66
  github_branch: main
57
67
  ```
58
68
 
59
- <%= warning_text('All of these settings are optional. However, you should enable or disable settings to increase the usability of your documentation or because of best practice.') %>
69
+ <%= govukWarningText({text: "All of these settings are optional. However, you should enable or disable settings to increase the usability of your documentation or because of best practice.", iconFallbackText: "Warning"}) %>
60
70
 
61
71
  You must wrap a value in quotes if it contains a colon, unless the value is a URL. For example:
62
72
 
@@ -88,6 +98,18 @@ Enables and disables the GOV.UK crown logo in the top left corner of the site. D
88
98
  show_govuk_logo: true
89
99
  ```
90
100
 
101
+ <%= govukWarningText({text: "This setting is deprecated and will be replaced in version 7 by the generic header and custom logo options.", iconFallbackText: "Warning"}) %>
102
+
103
+ ### product_name
104
+
105
+ Used for the `productName` value in the [GOV.UK header component](https://design-system.service.gov.uk/components/header/). It is used when the product name follows on directly from ‘GOV.UK’. For example, GOV.UK Pay or GOV.UK Design System. In most circumstances, you should use the Service navigation component.
106
+
107
+ ```yaml
108
+ product_name: "Great new product"
109
+ ```
110
+
111
+
112
+
91
113
  ### service_name
92
114
 
93
115
  Defines the service name in the header. Defaults to "My First Service" if you do not define it when creating your project.
@@ -112,7 +134,35 @@ Defines the phase of the service that the documentation is attached to. Defaults
112
134
  phase: "Beta"
113
135
  ```
114
136
 
115
- ### enable_govuk_components
137
+ ### Header and footer custom styles
138
+
139
+ If you have set `show_gouk_logo` to `true`, the header, service navigation and footer will use GOV.UK components.
140
+
141
+ #### Container classes
142
+
143
+ Classes for the container, useful if you want to make the header fixed width. The container settings you can configure are:
144
+
145
+ - `headerContainerClasses:`
146
+ - `navigationContainerClasses:`
147
+ - `footerContainerClasses:`
148
+
149
+ ```yaml
150
+ headerContainerClasses: "my-custom-container-style my-additional-styles"
151
+ ```
152
+
153
+ You can add custom classes to the components in the same way. The settings you can configure are:
154
+
155
+ - `headerClasses:`
156
+ - `navigationClasses:`
157
+ - `footerClasses:`
158
+
159
+ ```yaml
160
+ footerClasses: "my-custom-footer-style"
161
+ ```
162
+
163
+ There is more detail on the [GOV.UK Design System](https://design-system.service.gov.uk/components) documentation site.
164
+
165
+ ### Govuk components
116
166
 
117
167
  The `tech-docs-gem` contains a custom extension to allow you to use [GOV.UK Design System components](https://design-system.service.gov.uk/components). You can include these in your content by creating a `ruby` codeblock, and calling the component as described in the GOV.UK Design System documentation. For example, you can include a [GOV.UK Button](https://design-system.service.gov.uk/components/button/):
118
168
 
@@ -123,7 +173,7 @@ The `tech-docs-gem` contains a custom extension to allow you to use [GOV.UK Desi
123
173
  This would be a short introduction, but now we need a button!
124
174
 
125
175
 
126
- <%%= govukButton({
176
+ <%= govukButton({
127
177
  text: "Click me!"
128
178
  }) %>
129
179
 
@@ -23,8 +23,8 @@ Fetching gem metadata from https://rubygems.org/.............
23
23
  Fetching gem metadata from https://rubygems.org/.
24
24
  Resolving dependencies.......
25
25
  <...>
26
- Fetching govuk_tech_docs 2.0.11 (was 2.0.10)
27
- Installing govuk_tech_docs 2.0.11 (was 2.0.10)
26
+ Fetching govuk_tech_docs 6.4.1.0 (was 6.2.0)
27
+ Installing govuk_tech_docs 6.4.1.0 (was 6.2.0)
28
28
  <...>
29
29
  Bundle updated!
30
30
  ```
@@ -29,16 +29,16 @@ This method relies on adding a `Staticfile.auth` file to the `build` folder beca
29
29
 
30
30
  1. In the command line, navigate to your local documentation repo.
31
31
 
32
- 1. If required, run `bundle exec middleman build` to create a `build` folder.
32
+ 2. If required, run `bundle exec middleman build` to create a `build` folder.
33
33
 
34
- 1. Create a new `Staticfile.auth` file in the `build` folder.
34
+ 3. Create a new `Staticfile.auth` file in the `build` folder.
35
35
 
36
- 1. Go to the [Htpasswd Generator].
36
+ 4. Go to the [Htpasswd Generator].
37
37
 
38
- 1. Complete the __Username__ and __Password__ fields, and select __Create .htpasswd file__.
38
+ 5. Complete the __Username__ and __Password__ fields, and select __Create .htpasswd file__.
39
39
 
40
- 1. Copy the generated username and password hash into the `Staticfile.auth` file and save.
40
+ 6. Copy the generated username and password hash into the `Staticfile.auth` file and save.
41
41
 
42
- 1. Deploy your documentation site in line with your normal process.
42
+ 7. Deploy your documentation site in line with your normal process.
43
43
 
44
44
  <%= partial "partials/links" %>
@@ -110,6 +110,8 @@ You must include alt text for an image if the image has not been explained in su
110
110
 
111
111
  ## Insert a warning
112
112
 
113
+ <%= govukWarningText({text: "This setting is deprecated and will be removed in version 7. You should use the GOV.UK warning text component.", iconFallbackText: "Warning"}) %>
114
+
113
115
  Use the warning text component when you need to warn users about something important, such as legal consequences of an action, or lack of action, that they might take.
114
116
 
115
117
  This warning text format is consistent with the [GOV.UK Design System warning text][design-system].
@@ -117,12 +119,26 @@ This warning text format is consistent with the [GOV.UK Design System warning te
117
119
  To insert a warning, use the following:
118
120
 
119
121
  ```ruby
120
- <%%= warning_text('insert warning text here') %>
122
+ <%= warning_text('insert warning text here') %>
121
123
  ```
122
124
 
125
+
123
126
  ## Use the GOV.UK Design System
124
127
 
125
- Use [GOV.UK Design System](https://design-system.service.gov.uk/) elements in your documentation to ensure your content complies with accessibility regulations.
128
+ Use [GOV.UK Design System](https://design-system.service.gov.uk/) elements in your documentation to ensure your content complies with accessibility regulations. To use a component from the design system call the component function inside a ruby block. For example:
129
+
130
+ ```
131
+ <%=
132
+ govukPhaseBanner({
133
+ tag: {
134
+ text: "Alpha"
135
+ },
136
+ html: 'This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback by email</a>.'
137
+ })
138
+ %>
139
+ ```
140
+
141
+ You do not need to import the function using `from "govuk/components/{COMPONENT_NAME}/macro.njk" import {COMPONENT_NAME}`. The extension will do this automatically.
126
142
 
127
143
 
128
144
  <%= partial "partials/links" %>
@@ -14,15 +14,7 @@ $govuk-new-link-styles: true;
14
14
  @import "govuk/core";
15
15
  @import "govuk/objects";
16
16
 
17
- @import "govuk/components/cookie-banner";
18
- @import "govuk/components/footer";
19
- @import "govuk/components/header";
20
- @import "govuk/components/service-navigation";
21
- @import "govuk/components/inset-text";
22
- @import "govuk/components/input";
23
- @import "govuk/components/tag";
24
- @import "govuk/components/skip-link";
25
- @import "govuk/components/warning-text";
17
+ @import "govuk/components";
26
18
 
27
19
  @import "govuk/utilities";
28
20
  @import "govuk/overrides";
@@ -15,7 +15,10 @@
15
15
  @extend %govuk-heading-xl;
16
16
 
17
17
  &:first-of-type {
18
- padding-top: govuk-spacing(6);
18
+ padding-top: govuk-spacing(4);
19
+ @include govuk-media-query(tablet) {
20
+ padding-top: govuk-spacing(8);
21
+ }
19
22
  }
20
23
  }
21
24
 
@@ -1,3 +1,3 @@
1
1
  module GovukTechDocs
2
- VERSION = "6.4.1.0".freeze
2
+ VERSION = "6.5.0".freeze
3
3
  end
@@ -5,8 +5,8 @@ module GovukTechDocs
5
5
  end
6
6
 
7
7
  helpers do
8
- warn("This functionality is deprecated and will be removed in a future release. \n You should use the GOV.UK warning text component instead.")
9
8
  def warning_text(text)
9
+ warn("The `warning_text` function will be removed in version 7. You should use the GOV.UK warning text component instead.")
10
10
  <<~EOS
11
11
  <div class="govuk-warning-text">
12
12
  <span class="govuk-warning-text__icon" aria-hidden="true">!</span>
@@ -84,6 +84,7 @@ module GovukTechDocs
84
84
  context.activate :unique_identifier
85
85
  context.activate :warning_text
86
86
  context.activate :api_reference
87
+ context.activate :custom_method_missing_handler
87
88
 
88
89
  context.helpers do
89
90
  include GovukTechDocs::PathHelpers
@@ -164,9 +165,5 @@ module GovukTechDocs
164
165
  else
165
166
  context.ignore "search/*"
166
167
  end
167
-
168
- if context.config[:tech_docs][:enable_govuk_components]
169
- context.activate :custom_method_missing_handler
170
- end
171
168
  end
172
169
  end
@@ -0,0 +1,9 @@
1
+ <%=
2
+
3
+ govukFooter({
4
+ containerClasses: config[:tech_docs][:footerContainerClasses] ? config[:tech_docs][:footerContainerClasses] : "govuk-footer__container--full-width",
5
+ classes: config[:tech_docs][:footerClasses] ? config[:tech_docs][:footerClasses] : "",
6
+
7
+ })
8
+
9
+ %>
@@ -0,0 +1,17 @@
1
+ <%
2
+ service_link = config[:tech_docs][:service_link]
3
+ homepage_url = service_link ? get_path_to_resource(config, service_link, current_page) : nil
4
+
5
+ %>
6
+
7
+ <%=
8
+
9
+ govukHeader({
10
+ homepageUrl: homepage_url || "",
11
+ productName: config[:tech_docs][:product_name] ? config[:tech_docs][:product_name] : "",
12
+ containerClasses: config[:tech_docs][:headerContainerClasses] ? config[:tech_docs][:headerContainerClasses] : "govuk-header__container--full-width",
13
+ classes: config[:tech_docs][:headerClasses] ? config[:tech_docs][:headerClasses] : ""
14
+
15
+ })
16
+
17
+ %>
@@ -1,24 +1,24 @@
1
- <div class="govuk-service-navigation app-pane__navigation" data-module="govuk-service-navigation">
2
- <div class="govuk-width-container">
3
- <div class="govuk-service-navigation__container">
4
- <nav aria-label="Menu" class="govuk-service-navigation__wrapper">
5
- <button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="navigation" hidden aria-hidden="true">
6
- Menu
7
- </button>
8
- <ul class="govuk-service-navigation__list" id="navigation">
9
- <% config[:tech_docs][:header_links].each do |title, path| %>
10
- <li class="govuk-service-navigation__item <% if active_page(path) %> govuk-service-navigation__item--active<% end %>">
11
- <a class="govuk-service-navigation__link" href="<%= get_path_to_resource config, path, current_page %>"<% if active_page(path) %> aria-current="page"<% end %>>
12
- <% if active_page(path) %>
13
- <strong class="govuk-service-navigation__active-fallback"><%= title %></strong>
14
- <% else %>
15
- <%= title %>
16
- <% end %>
17
- </a>
18
- </li>
19
- <% end %>
20
- </ul>
21
- </nav>
22
- </div>
23
- </div>
24
- </div>
1
+ <%
2
+
3
+ navigation = []
4
+ config[:tech_docs][:header_links].each do |title, path|
5
+ url = get_path_to_resource config, path, current_page
6
+ navigation.append << {
7
+ href: url,
8
+ text: title,
9
+ active: active_page(path)
10
+ }
11
+ end
12
+
13
+ %>
14
+
15
+
16
+ <%=
17
+ govukServiceNavigation({
18
+ navigation: navigation,
19
+ serviceUrl: config[:tech_docs][:service_link] ,
20
+ serviceName: config[:tech_docs][:service_name],
21
+ navigationClasses: config[:tech_docs][:navigationContainerClasses] ? config[:tech_docs][:navigationContainerClasses] : "",
22
+ classes: config[:tech_docs][:navigationClasses] ? config[:tech_docs][:navigationClasses] : ""
23
+ })
24
+ %>
@@ -50,9 +50,23 @@
50
50
 
51
51
  <body class="govuk-template__body">
52
52
  <script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
53
- <header class="govuk-template__header app-header">
54
- <%= partial 'layouts/header' %>
55
- </header>
53
+ <!-- .app-header aligns the header component properly with the in page navigation -->
54
+ <div class="app-header" role="banner" data-module="govuk-header">
55
+ <% if config[:tech_docs][:show_govuk_logo] %>
56
+ <%= partial 'layouts/govuk_header' %>
57
+ <% else %>
58
+ <%=
59
+ # if show govuk_logo is true we can just use the govuk component.
60
+ # If not we need to fall back temporarily to the old custom header to make sure we don't start
61
+ # showing logos everywhere, as there is no option in the component to turn it off. This will be removed once the generic header and branding is in place.
62
+ # We will raise a deprecation warning to let people know this is imminent
63
+ warn("You have set show_govuk_logo to false or removed it from your config. This setting wil be removed in version 7 to be replaced by the generic header and custom logo. If you rely on this setting for custom code you should review this as soon as possible.")
64
+ %>
65
+ <%= partial 'layouts/header' %>
66
+ <% end %>
67
+
68
+ </div>
69
+
56
70
  <% if config[:tech_docs][:header_links] %>
57
71
  <%= partial 'layouts/service_navigation' %>
58
72
  <% end %>
@@ -102,9 +116,12 @@
102
116
  </div>
103
117
  </div>
104
118
 
105
-
106
119
  <footer class="govuk-template__footer">
107
- <%= partial "layouts/footer" %>
120
+ <% if config[:tech_docs][:show_govuk_logo] %>
121
+ <%= partial "layouts/govuk_footer" %>
122
+ <% else %>
123
+ <%= partial "layouts/footer" %>
124
+ <% end %>
108
125
  </footer>
109
126
 
110
127
  <%= partial 'layouts/analytics' %>
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: 6.4.1.0
4
+ version: 6.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Government Digital Service
@@ -543,6 +543,8 @@ files:
543
543
  - lib/source/layouts/_analytics_ga4_gtm.erb
544
544
  - lib/source/layouts/_cookie_banner.erb
545
545
  - lib/source/layouts/_footer.erb
546
+ - lib/source/layouts/_govuk_footer.erb
547
+ - lib/source/layouts/_govuk_header.erb
546
548
  - lib/source/layouts/_header.erb
547
549
  - lib/source/layouts/_page_review.erb
548
550
  - lib/source/layouts/_search.erb