@companieshouse/ch-node-utils 2.1.12 → 3.0.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.
- package/README.md +1 -1
- package/package.json +3 -4
- package/templates/layouts/template.njk +5 -18
- package/templates/navbar.njk +1 -1
package/README.md
CHANGED
|
@@ -141,7 +141,7 @@ The navbar uses translations from `@companieshouse/ch-node-utils` (this) package
|
|
|
141
141
|
|
|
142
142
|
The navbar also requires the use of styles provided in the [ch.gov.uk.css](https://github.com/companieshouse/cdn.ch.gov.uk/blob/master/app/assets/stylesheets/ch.gov.uk.css) stylesheet (you can either add the provided link to the head section or include specific styles in your own stylesheet)
|
|
143
143
|
|
|
144
|
-
`<link href="{{ cdnHost }}/stylesheets/ch.gov.uk.css" rel="stylesheet"
|
|
144
|
+
`<link href="{{ cdnHost }}/stylesheets/ch.gov.uk.css" rel="stylesheet"/>`
|
|
145
145
|
|
|
146
146
|
It also requires the [navbar.js](https://github.com/companieshouse/cdn.ch.gov.uk/blob/master/app/assets/javascripts/lib/navbar.js) script to be added to the footer to make the navbar work in mobile mode (make sure it's the latest version).
|
|
147
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companieshouse/ch-node-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"author": "companieshouse",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
"@types/ioredis": "4.28.10",
|
|
42
42
|
"@types/jest": "^29.5.14",
|
|
43
43
|
"@types/node": "^20.11.28",
|
|
44
|
-
"govuk-frontend-
|
|
45
|
-
"govuk-frontend-5-10-2": "npm:govuk-frontend@^5.10.2",
|
|
44
|
+
"govuk-frontend-6-0-0": "npm:govuk-frontend@6.0.0",
|
|
46
45
|
"jest": "^29.7.0",
|
|
47
46
|
"jest-environment-jsdom": "^29.7.0",
|
|
48
47
|
"nunjucks": "^3.2.4",
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"typescript": "^5.4.2"
|
|
51
50
|
},
|
|
52
51
|
"peerDependencies": {
|
|
53
|
-
"govuk-frontend": "^
|
|
52
|
+
"govuk-frontend": "^6.0.0"
|
|
54
53
|
},
|
|
55
54
|
"bugs": {
|
|
56
55
|
"url": "https://github.com/companieshouse/ch-node-utils/issues"
|
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
{% extends "govuk/template.njk" %}
|
|
3
3
|
|
|
4
4
|
{% set _cdnImageRootPath = cdnHost + "/images/govuk-frontend/v" + govukFrontendVersion %}
|
|
5
|
-
{% if govukRebrand %}
|
|
6
|
-
{% set _cdnImageRootPath = _cdnImageRootPath + "/rebrand" %}
|
|
7
|
-
{% endif %}
|
|
8
|
-
|
|
9
5
|
{% set _cdnManifestRootPath = cdnHost + "/static/govuk-frontend/v" + govukFrontendVersion %}
|
|
10
|
-
{% if govukRebrand %}
|
|
11
|
-
{% set _cdnManifestRootPath = _cdnManifestRootPath + "/rebrand" %}
|
|
12
|
-
{% endif %}
|
|
13
6
|
|
|
14
7
|
{# GOV.UK Frontend Page Template option for Open Graph https://design-system.service.gov.uk/styles/page-template/#options #}
|
|
15
8
|
{% set opengraphImageUrl = _cdnImageRootPath + "/govuk-opengraph-image.png" %}
|
|
@@ -24,19 +17,13 @@
|
|
|
24
17
|
{% endblock %}
|
|
25
18
|
|
|
26
19
|
{% block head %}
|
|
27
|
-
<link rel="stylesheet" href="{{ cdnHost }}/stylesheets/govuk-frontend/v{{ govukFrontendVersion }}/govuk-frontend-{{ govukFrontendVersion }}.min.css"
|
|
20
|
+
<link rel="stylesheet" href="{{ cdnHost }}/stylesheets/govuk-frontend/v{{ govukFrontendVersion }}/govuk-frontend-{{ govukFrontendVersion }}.min.css">
|
|
28
21
|
{% endblock %}
|
|
29
22
|
|
|
30
23
|
{% block bodyEnd %}
|
|
31
24
|
{# Run JavaScript at end of the <body>, to avoid blocking the initial render. #}
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
initAll()
|
|
37
|
-
</script>
|
|
38
|
-
{% else %}
|
|
39
|
-
<script src="{{ cdnHost }}/javascripts/govuk-frontend/v{{ govukFrontendVersion }}/govuk-frontend-{{ govukFrontendVersion }}.min.js"></script>
|
|
40
|
-
<script{% if nonce %} nonce="{{ nonce }}"{% endif %}>window.GOVUKFrontend.initAll()</script>
|
|
41
|
-
{% endif %}
|
|
25
|
+
<script type="module"{% if cspNonce %} nonce="{{ cspNonce }}"{% endif %}>
|
|
26
|
+
import { initAll } from '{{ cdnHost }}/javascripts/govuk-frontend/v{{ govukFrontendVersion }}/govuk-frontend-{{ govukFrontendVersion }}.min.js'
|
|
27
|
+
initAll()
|
|
28
|
+
</script>
|
|
42
29
|
{% endblock %}
|
package/templates/navbar.njk
CHANGED
|
@@ -9,7 +9,7 @@ It also requires the use of styles provided in the following stylesheet
|
|
|
9
9
|
(you can either add the provided link to the head section or include specific
|
|
10
10
|
styles in your own stylesheet)
|
|
11
11
|
|
|
12
|
-
<link href="{{ cdnHost }}/stylesheets/ch.gov.uk.css" rel="stylesheet"
|
|
12
|
+
<link href="{{ cdnHost }}/stylesheets/ch.gov.uk.css" rel="stylesheet"/>
|
|
13
13
|
|
|
14
14
|
It also requires the following script to be added to the footer
|
|
15
15
|
|