@x-govuk/nhsuk-eleventy-plugin 1.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/LICENSE.txt +22 -0
- package/README.md +35 -0
- package/package.json +102 -0
- package/src/application.js +11 -0
- package/src/application.scss +2 -0
- package/src/components/_index.scss +12 -0
- package/src/components/attribution/_index.scss +13 -0
- package/src/components/blockquote/_index.scss +22 -0
- package/src/components/card-group/macro.njk +3 -0
- package/src/components/card-group/template.njk +26 -0
- package/src/components/code/_index.scss +153 -0
- package/src/components/contents-list/_index.scss +18 -0
- package/src/components/document-header/macro.njk +3 -0
- package/src/components/document-header/template.njk +10 -0
- package/src/components/document-list/macro.njk +3 -0
- package/src/components/document-list/template.njk +22 -0
- package/src/components/footnotes-list/_index.scss +55 -0
- package/src/components/heading/macro.njk +3 -0
- package/src/components/heading/template.njk +15 -0
- package/src/components/hero/_index.scss +17 -0
- package/src/components/hero/macro.njk +3 -0
- package/src/components/hero/template.njk +36 -0
- package/src/components/image/_index.scss +8 -0
- package/src/components/metadata/_index.scss +24 -0
- package/src/components/metadata/macro.njk +3 -0
- package/src/components/metadata/template.njk +50 -0
- package/src/components/prose-scope/_index.scss +72 -0
- package/src/components/prose-scope/macro.njk +3 -0
- package/src/components/prose-scope/template.njk +4 -0
- package/src/components/related/_index.scss +10 -0
- package/src/components/related/macro.njk +3 -0
- package/src/components/related/template.njk +17 -0
- package/src/components/search/_index.scss +120 -0
- package/src/components/search/search.js +133 -0
- package/src/components/sub-navigation/_index.scss +71 -0
- package/src/components/sub-navigation/macro.njk +3 -0
- package/src/components/sub-navigation/template.njk +27 -0
- package/src/data/eleventy-computed.js +17 -0
- package/src/data/options.js +49 -0
- package/src/events/generate-nhsuk-assets.js +57 -0
- package/src/filters/current-page.js +18 -0
- package/src/filters/index.js +21 -0
- package/src/filters/items-from-collection.js +73 -0
- package/src/filters/markdown.js +20 -0
- package/src/index.js +136 -0
- package/src/index.scss +5 -0
- package/src/layouts/base.njk +81 -0
- package/src/layouts/collection.njk +38 -0
- package/src/layouts/error.njk +11 -0
- package/src/layouts/feed.njk +32 -0
- package/src/layouts/hub.njk +31 -0
- package/src/layouts/page.njk +31 -0
- package/src/layouts/post.njk +47 -0
- package/src/layouts/product.njk +32 -0
- package/src/layouts/sitemap.njk +25 -0
- package/src/layouts/sub-navigation.njk +40 -0
- package/src/layouts/tag.njk +14 -0
- package/src/layouts/tags.njk +18 -0
- package/src/markdown-it/alert.js +36 -0
- package/src/markdown-it/deflist.js +16 -0
- package/src/markdown-it/figure.js +12 -0
- package/src/markdown-it/footnote.js +47 -0
- package/src/markdown-it/table.js +18 -0
- package/src/markdown-it.js +91 -0
- package/src/nunjucks.js +65 -0
- package/src/vendor/nhsuk-frontend/_index.scss +2 -0
- package/src/vendor/nhsuk-frontend/components/_index.scss +15 -0
- package/src/vendor/nhsuk-frontend/core/_index.scss +1 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 X-GOVUK
|
|
4
|
+
Copyright (c) 2019 NHS Digital
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
7
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
8
|
+
the Software without restriction, including without limitation the rights to
|
|
9
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
10
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
11
|
+
so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# NHS.UK Eleventy Plugin • [](https://github.com/x-govuk/nhsuk-eleventy-plugin/actions/workflows/test.yml)
|
|
2
|
+
|
|
3
|
+
Build documentation websites using Markdown and NHS.UK styles.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- [Node.js](https://nodejs.org) v22 or later
|
|
8
|
+
- [Eleventy](https://www.11ty.dev) v3 or later
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
`npm install @x-govuk/nhsuk-eleventy-plugin`
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { nhsukEleventyPlugin } from '@x-govuk/nhsuk-eleventy-plugin'
|
|
18
|
+
|
|
19
|
+
export default function(eleventyConfig) {
|
|
20
|
+
eleventyConfig.addPlugin(nhsukEleventyPlugin, {
|
|
21
|
+
// Options
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Learn more about how to [get started](https://x-govuk.github.io/nhsuk-eleventy-plugin/get-started/) and which [options you can provide](https://x-govuk.github.io/nhsuk-eleventy-plugin/get-started/options/).
|
|
27
|
+
|
|
28
|
+
## Releasing a new version
|
|
29
|
+
|
|
30
|
+
`npm run release`
|
|
31
|
+
|
|
32
|
+
This command will ask you what version you want to use. It will then publish a new version on NPM, create and push a new git tag and then generate release notes ready for posting on GitHub.
|
|
33
|
+
|
|
34
|
+
> [!NOTE]
|
|
35
|
+
> Releasing a new version requires permission to publish packages to the `@x-govuk` organisation.
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@x-govuk/nhsuk-eleventy-plugin",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Write documentation using Markdown and publish it using NHS.UK styles",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"nhsuk",
|
|
7
|
+
"healthcare",
|
|
8
|
+
"eleventy",
|
|
9
|
+
"eleventy-plugin"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://x-govuk.github.io/nhsuk-eleventy-plugin/",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "git+https://github.com/x-govuk/nhsuk-eleventy-plugin/issues"
|
|
14
|
+
},
|
|
15
|
+
"contributors": [
|
|
16
|
+
{
|
|
17
|
+
"name": "Paul Robert Lloyd",
|
|
18
|
+
"url": "https://paulrobertlloyd.com"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"files": [
|
|
23
|
+
"src"
|
|
24
|
+
],
|
|
25
|
+
"main": "src/index.js",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/x-govuk/nhsuk-eleventy-plugin.git"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"prebuild": "rimraf _site",
|
|
32
|
+
"postbuild": "npm run build:example",
|
|
33
|
+
"build": "eleventy",
|
|
34
|
+
"build:example": "eleventy --config=example.config.js",
|
|
35
|
+
"predev": "npm run build",
|
|
36
|
+
"dev": "eleventy --serve --watch",
|
|
37
|
+
"dev:example": "eleventy --config=example.config.js --serve --watch",
|
|
38
|
+
"start": "eleventy --serve",
|
|
39
|
+
"lint:prettier": "prettier . --check",
|
|
40
|
+
"lint:prettier:fix": "prettier . --write",
|
|
41
|
+
"lint:js": "eslint '**/*.js'",
|
|
42
|
+
"lint:js:fix": "eslint '**/*.js' --fix",
|
|
43
|
+
"lint:scss": "stylelint '**/*.scss'",
|
|
44
|
+
"lint:scss:fix": "stylelint '**/*.scss' --fix",
|
|
45
|
+
"lint": "npm run lint:prettier && npm run lint:js && npm run lint:scss",
|
|
46
|
+
"lint:fix": "npm run lint:prettier:fix && npm run lint:js:fix && npm run lint:scss:fix",
|
|
47
|
+
"test": "node --test",
|
|
48
|
+
"coverage": "node --test --experimental-test-coverage",
|
|
49
|
+
"release": "np"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@11ty/eleventy": "^3.0.0",
|
|
56
|
+
"@11ty/eleventy-navigation": "^1.0.0",
|
|
57
|
+
"@rollup/plugin-commonjs": "^28.0.0",
|
|
58
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
59
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
60
|
+
"@x-govuk/govuk-eleventy-plugin": "^8.0.0",
|
|
61
|
+
"accessible-autocomplete": "^3.0.1",
|
|
62
|
+
"deepmerge": "^4.2.2",
|
|
63
|
+
"markdown-it-abbr": "^2.0.0",
|
|
64
|
+
"markdown-it-anchor": "^9.0.0",
|
|
65
|
+
"markdown-it-attribution": "^0.1.4",
|
|
66
|
+
"markdown-it-attrs": "^4.3.1",
|
|
67
|
+
"markdown-it-deflist": "^3.0.0",
|
|
68
|
+
"markdown-it-footnote": "^4.0.0",
|
|
69
|
+
"markdown-it-github-alerts": "^1.0.0",
|
|
70
|
+
"markdown-it-govuk": "^0.7.0",
|
|
71
|
+
"markdown-it-image-figures": "^2.0.0",
|
|
72
|
+
"markdown-it-ins": "^4.0.0",
|
|
73
|
+
"markdown-it-mark": "^4.0.0",
|
|
74
|
+
"markdown-it-sub": "^2.0.0",
|
|
75
|
+
"markdown-it-sup": "^2.0.0",
|
|
76
|
+
"markdown-it-table-of-contents": "^0.9.0",
|
|
77
|
+
"nhsuk-frontend": "^10.0.0",
|
|
78
|
+
"rimraf": "^6.0.0",
|
|
79
|
+
"rollup": "^4.1.0",
|
|
80
|
+
"sass": "^1.45.1"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@x-govuk/eslint-config": "^0.0.1",
|
|
84
|
+
"@x-govuk/nhsuk-eleventy-plugin": "file:./",
|
|
85
|
+
"np": "^10.0.0",
|
|
86
|
+
"prettier": "^3.1.0",
|
|
87
|
+
"stylelint": "^16.0.0",
|
|
88
|
+
"stylelint-config-gds": "^2.0.0",
|
|
89
|
+
"stylelint-order": "^7.0.0"
|
|
90
|
+
},
|
|
91
|
+
"engines": {
|
|
92
|
+
"node": ">=22"
|
|
93
|
+
},
|
|
94
|
+
"type": "module",
|
|
95
|
+
"exports": {
|
|
96
|
+
".": {
|
|
97
|
+
"import": "./src/index.js",
|
|
98
|
+
"module-sync": "./src/index.js",
|
|
99
|
+
"sass": "./src/index.scss"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { initAll } from 'nhsuk-frontend'
|
|
2
|
+
|
|
3
|
+
import { SearchElement } from './components/search/search.js'
|
|
4
|
+
|
|
5
|
+
// Initiate custom elements
|
|
6
|
+
customElements.define('app-search', SearchElement)
|
|
7
|
+
|
|
8
|
+
// Initiate scripts on page load
|
|
9
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
10
|
+
initAll()
|
|
11
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@forward "attribution";
|
|
2
|
+
@forward "blockquote";
|
|
3
|
+
@forward "code";
|
|
4
|
+
@forward "contents-list";
|
|
5
|
+
@forward "footnotes-list";
|
|
6
|
+
@forward "hero";
|
|
7
|
+
@forward "image";
|
|
8
|
+
@forward "metadata";
|
|
9
|
+
@forward "prose-scope";
|
|
10
|
+
@forward "related";
|
|
11
|
+
@forward "search";
|
|
12
|
+
@forward "sub-navigation";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@use "../../vendor/nhsuk-frontend" as *;
|
|
2
|
+
|
|
3
|
+
@include nhsuk-exports("nhsuk-eleventy-plugin/components/attribution") {
|
|
4
|
+
.app-attribution {
|
|
5
|
+
margin: 0 0 nhsuk-spacing(4);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.app-attribution__caption {
|
|
9
|
+
color: $nhsuk-secondary-text-colour;
|
|
10
|
+
margin: nhsuk-spacing(-2) 0 nhsuk-spacing(6);
|
|
11
|
+
padding: 0 0 0 nhsuk-spacing(6);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@use "../../vendor/nhsuk-frontend" as *;
|
|
2
|
+
|
|
3
|
+
@include nhsuk-exports("nhsuk-eleventy-plugin/components/blockquote") {
|
|
4
|
+
.app-blockquote {
|
|
5
|
+
margin: 0 0 nhsuk-spacing(4);
|
|
6
|
+
padding: 0 0 0 nhsuk-spacing(6);
|
|
7
|
+
|
|
8
|
+
p {
|
|
9
|
+
position: relative;
|
|
10
|
+
|
|
11
|
+
&::before {
|
|
12
|
+
content: "\201C";
|
|
13
|
+
position: absolute;
|
|
14
|
+
right: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:last-of-type::after {
|
|
18
|
+
content: "\201D";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{% from "nhsuk/components/card/macro.njk" import card as nhsukCard %}
|
|
2
|
+
|
|
3
|
+
{% if params.columns == 2 %}{% set grid = "one-half" %}
|
|
4
|
+
{% elif params.columns == 3 %}{% set grid = "one-third" %}
|
|
5
|
+
{% elif params.columns == 4 %}{% set grid = "one-quarter" %}
|
|
6
|
+
{% else %}{% set grid = "full" %}{% endif %}
|
|
7
|
+
|
|
8
|
+
<ul class="nhsuk-grid-row nhsuk-card-group">
|
|
9
|
+
{% set items = getData(params.items) | itemsFromCollection(params.limit) %}
|
|
10
|
+
{% for item in items %}
|
|
11
|
+
<li class="nhsuk-grid-column-{{ grid }} nhsuk-card-group__item">
|
|
12
|
+
{{ nhsukCard({
|
|
13
|
+
clickable: item.href and params.clickable,
|
|
14
|
+
primary: params.type == "primary",
|
|
15
|
+
secondary: params.type == "secondary",
|
|
16
|
+
heading: item.heading,
|
|
17
|
+
headingClasses: "nhsuk-u-font-size-22" if params.title else "nhsuk-u-font-size-26" + (" nhsuk-u-margin-bottom-2" if item.descriptionHtml else ""),
|
|
18
|
+
headingLevel: 3 if params.title else 2,
|
|
19
|
+
href: item.href,
|
|
20
|
+
descriptionHtml: item.descriptionHtml,
|
|
21
|
+
imgALT: item.imgALT,
|
|
22
|
+
imgURL: item.imgURL
|
|
23
|
+
}) | indent(4) }}
|
|
24
|
+
</li>
|
|
25
|
+
{% endfor %}
|
|
26
|
+
</ul>
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@use "../../vendor/nhsuk-frontend" as *;
|
|
2
|
+
|
|
3
|
+
// Use same colour for inline code as that used on NHS.UK Digital service manual.
|
|
4
|
+
// https://github.com/nhsuk/nhsuk-service-manual/blob/main/app/stylesheets/app/_code-highlight.scss
|
|
5
|
+
$_code-colour: #dd1144;
|
|
6
|
+
|
|
7
|
+
@include nhsuk-exports("nhsuk-eleventy-plugin/components/code") {
|
|
8
|
+
.app-code--inline,
|
|
9
|
+
.app-code--block {
|
|
10
|
+
font-family: ui-monospace, monospace;
|
|
11
|
+
-webkit-font-smoothing: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.app-code--inline {
|
|
15
|
+
background-color: nhsuk-colour("white");
|
|
16
|
+
color: $_code-colour;
|
|
17
|
+
font-size: 0.875em;
|
|
18
|
+
padding: 2px nhsuk-spacing(1);
|
|
19
|
+
|
|
20
|
+
a & {
|
|
21
|
+
color: inherit;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Ensure links within inline code blocks receive focus colour
|
|
25
|
+
a:focus & {
|
|
26
|
+
background: $nhsuk-focus-colour;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.app-code--block {
|
|
31
|
+
background-color: nhsuk-colour("white");
|
|
32
|
+
overflow: auto;
|
|
33
|
+
padding: nhsuk-spacing(4);
|
|
34
|
+
scrollbar-color: nhsuk-colour("grey-1") $nhsuk-border-colour;
|
|
35
|
+
scrollbar-width: thin;
|
|
36
|
+
|
|
37
|
+
@include nhsuk-font(16, $line-height: 1.4);
|
|
38
|
+
@include nhsuk-responsive-margin(4, "bottom");
|
|
39
|
+
|
|
40
|
+
+ .nhsuk-heading-l {
|
|
41
|
+
padding-top: nhsuk-spacing(4);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
+ .nhsuk-heading-m,
|
|
45
|
+
+ .nhsuk-heading-s {
|
|
46
|
+
padding-top: nhsuk-spacing(2);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus {
|
|
50
|
+
box-shadow: 0 0 0 #{$nhsuk-focus-width * 2} $nhsuk-focus-colour;
|
|
51
|
+
outline: $nhsuk-focus-width solid nhsuk-colour("black");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Reverse the colour of code that uses shell highlighting
|
|
56
|
+
.app-code__language--shell {
|
|
57
|
+
background-color: nhsuk-colour("black");
|
|
58
|
+
border: $nhsuk-focus-width solid nhsuk-colour("white");
|
|
59
|
+
-webkit-font-smoothing: auto;
|
|
60
|
+
margin-left: $nhsuk-focus-width * -1;
|
|
61
|
+
margin-right: $nhsuk-focus-width * -1;
|
|
62
|
+
|
|
63
|
+
code {
|
|
64
|
+
filter: invert(100%);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.app-code__comment,
|
|
69
|
+
.app-code__quote {
|
|
70
|
+
color: nhsuk-tint(nhsuk-colour("grey-1"), 30);
|
|
71
|
+
font-style: italic;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.app-code__keyword,
|
|
75
|
+
.app-code__selector-tag,
|
|
76
|
+
.app-code__subst {
|
|
77
|
+
color: nhsuk-colour("black");
|
|
78
|
+
font-weight: bold;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.app-code__number,
|
|
82
|
+
.app-code__literal,
|
|
83
|
+
.app-code__variable,
|
|
84
|
+
.app-code__template-variable,
|
|
85
|
+
.app-code__tag .app-code__attr {
|
|
86
|
+
color: nhsuk-colour("green");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.app-code__string,
|
|
90
|
+
.app-code__doctag {
|
|
91
|
+
color: nhsuk-colour("red");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.app-code__title,
|
|
95
|
+
.app-code__section,
|
|
96
|
+
.app-code__selector-id {
|
|
97
|
+
color: nhsuk-colour("purple");
|
|
98
|
+
font-weight: bold;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.app-code__subst {
|
|
102
|
+
font-weight: normal;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.app-code__type,
|
|
106
|
+
.app-code__class .app-code__title {
|
|
107
|
+
color: nhsuk-colour("dark-pink");
|
|
108
|
+
font-weight: bold;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.app-code__tag,
|
|
112
|
+
.app-code__name,
|
|
113
|
+
.app-code__attribute {
|
|
114
|
+
color: $nhsuk-link-active-colour;
|
|
115
|
+
font-weight: normal;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.app-code__regexp,
|
|
119
|
+
.app-code__link {
|
|
120
|
+
color: nhsuk-colour("green");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.app-code__symbol,
|
|
124
|
+
.app-code__bullet {
|
|
125
|
+
color: nhsuk-colour("purple");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.app-code__builtin,
|
|
129
|
+
.app-code__builtin-name {
|
|
130
|
+
color: nhsuk-colour("blue");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.app-code__meta {
|
|
134
|
+
color: nhsuk-colour("grey-1");
|
|
135
|
+
font-weight: bold;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.app-code__deletion {
|
|
139
|
+
background: nhsuk-tint(nhsuk-colour("red"), 80);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.app-code__addition {
|
|
143
|
+
background: nhsuk-tint(nhsuk-colour("green"), 80);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.app-code__emphasis {
|
|
147
|
+
font-style: italic;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.app-code__strong {
|
|
151
|
+
font-weight: bold;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use "../../vendor/nhsuk-frontend" as *;
|
|
2
|
+
|
|
3
|
+
@include nhsuk-exports("nhsuk-eleventy-plugin/components/contents-list") {
|
|
4
|
+
.nhsuk-contents-list ol {
|
|
5
|
+
// stylelint-disable-next-line scss/at-extend-no-missing-placeholder
|
|
6
|
+
@extend .nhsuk-contents-list__list;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.nhsuk-contents-list li {
|
|
10
|
+
// stylelint-disable-next-line scss/at-extend-no-missing-placeholder
|
|
11
|
+
@extend .nhsuk-contents-list__item;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.nhsuk-contents-list a {
|
|
15
|
+
// stylelint-disable-next-line scss/at-extend-no-missing-placeholder
|
|
16
|
+
@extend .nhsuk-contents-list__link;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{% from "nhsuk/components/card/macro.njk" import card as nhsukCard %}
|
|
2
|
+
|
|
3
|
+
<div class="nhsuk-u-reading-width">
|
|
4
|
+
{% if params.items.length > 0 %}
|
|
5
|
+
<ol class="nhsuk-grid-row nhsuk-card-group{%- if params.classes %} {{ params.classes }}{% endif %}">
|
|
6
|
+
{% for item in params.items | itemsFromCollection %}
|
|
7
|
+
<li class="nhsuk-grid-column-full nhsuk-card-group__item">
|
|
8
|
+
{{ nhsukCard({
|
|
9
|
+
secondary: true,
|
|
10
|
+
heading: item.heading,
|
|
11
|
+
headingClasses: params.headingClasses or "nhsuk-u-font-size-22" + (" nhsuk-u-margin-bottom-2" if item.descriptionHtml else ""),
|
|
12
|
+
headingLevel: params.headingLevel or 2,
|
|
13
|
+
href: item.href,
|
|
14
|
+
descriptionHtml: item.descriptionHtml
|
|
15
|
+
}) | indent(6) }}
|
|
16
|
+
</li>
|
|
17
|
+
{% endfor %}
|
|
18
|
+
</ol>
|
|
19
|
+
{% else %}
|
|
20
|
+
<p class="nhsuk-body">No documents found.</p>
|
|
21
|
+
{% endif %}
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@use "../../vendor/nhsuk-frontend" as *;
|
|
2
|
+
|
|
3
|
+
@include nhsuk-exports("nhsuk-eleventy-plugin/components/footnotes-list") {
|
|
4
|
+
// Link to footnote
|
|
5
|
+
a[aria-describedby="footnotes-label"] {
|
|
6
|
+
@include nhsuk-font(16);
|
|
7
|
+
@include nhsuk-link-style-no-visited-state;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
a[aria-describedby="footnotes-label"]::before {
|
|
11
|
+
color: currentcolor;
|
|
12
|
+
content: "[";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
a[aria-describedby="footnotes-label"]::after {
|
|
16
|
+
color: currentcolor;
|
|
17
|
+
content: "]";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Footnotes
|
|
21
|
+
.app-footnotes-list {
|
|
22
|
+
counter-reset: footnotes;
|
|
23
|
+
list-style-type: none;
|
|
24
|
+
padding-left: 0;
|
|
25
|
+
|
|
26
|
+
li {
|
|
27
|
+
counter-increment: footnotes;
|
|
28
|
+
padding: nhsuk-spacing(3);
|
|
29
|
+
padding-left: nhsuk-spacing(8);
|
|
30
|
+
position: relative;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
li::before {
|
|
34
|
+
content: counter(footnotes) ".";
|
|
35
|
+
left: nhsuk-spacing(4);
|
|
36
|
+
position: absolute;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
a[aria-label="Back to content"] {
|
|
40
|
+
position: relative;
|
|
41
|
+
text-underline-offset: 0;
|
|
42
|
+
top: 2px;
|
|
43
|
+
|
|
44
|
+
@include nhsuk-link-style-no-visited-state;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:target {
|
|
48
|
+
background-color: nhsuk-tint($nhsuk-focus-colour, 75%);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:last-child {
|
|
52
|
+
margin-bottom: 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{% set level = params.level or 1 %}
|
|
2
|
+
{% set size = params.size or "xl" %}
|
|
3
|
+
{% if params.caption %}
|
|
4
|
+
<span class="nhsuk-caption-{{ size }}">
|
|
5
|
+
{{- params.caption -}}
|
|
6
|
+
</span>
|
|
7
|
+
{% endif %}
|
|
8
|
+
<h{{level}} class="nhsuk-heading-{{ size }}{%- if params.classes %} {{ params.classes }}{% endif %}">
|
|
9
|
+
{{- params.title | safe -}}
|
|
10
|
+
</h{{level}}>
|
|
11
|
+
{% if params.description -%}
|
|
12
|
+
<p class="{{ "nhsuk-lede-text" if level == 1 else "nhsuk-body nhsuk-u-reading-width" }}">
|
|
13
|
+
{{- params.description | markdown("inline") | noOrphans | safe -}}
|
|
14
|
+
</p>
|
|
15
|
+
{% endif %}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use "../../vendor/nhsuk-frontend" as *;
|
|
2
|
+
|
|
3
|
+
@include nhsuk-exports("nhsuk-eleventy-plugin/components/hero") {
|
|
4
|
+
.app-hero__caption {
|
|
5
|
+
color: $nhsuk-reverse-text-colour;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.app-hero__image {
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
|
|
11
|
+
@include nhsuk-responsive-padding(8, "top");
|
|
12
|
+
|
|
13
|
+
@include nhsuk-media-query($until: desktop) {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{% from "nhsuk/components/button/macro.njk" import button as nhsukButton %}
|
|
2
|
+
<div class="nhsuk-hero">
|
|
3
|
+
<div class="nhsuk-width-container nhsuk-hero--border">
|
|
4
|
+
<div class="nhsuk-grid-row">
|
|
5
|
+
<div class="nhsuk-grid-column-two-thirds">
|
|
6
|
+
<div class="nhsuk-hero__wrapper">
|
|
7
|
+
{% if params.caption %}
|
|
8
|
+
<span class="nhsuk-caption-xl app-hero__caption">
|
|
9
|
+
{{- params.caption -}}
|
|
10
|
+
</span>
|
|
11
|
+
{% endif %}
|
|
12
|
+
{% if params.title %}
|
|
13
|
+
<h1 class="nhsuk-hero__heading{%- if params.headingClasses %} {{ params.headingClasses }}{% endif %}">
|
|
14
|
+
{{- params.title | smart -}}
|
|
15
|
+
</h1>
|
|
16
|
+
{% endif %}
|
|
17
|
+
{% if params.description %}
|
|
18
|
+
<p class="nhsuk-body-l{% if not params.startButton %} nhsuk-u-margin-bottom-0{% endif %}">
|
|
19
|
+
{{- params.description | markdown("inline") | noOrphans -}}
|
|
20
|
+
</p>
|
|
21
|
+
{% endif %}
|
|
22
|
+
{{ nhsukButton({
|
|
23
|
+
classes: "nhsuk-button--reverse nhsuk-u-margin-0",
|
|
24
|
+
href: params.startButton.href,
|
|
25
|
+
text: params.startButton.text | default("Get started")
|
|
26
|
+
}) | indent(10) if params.startButton }}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
{% if params.image %}
|
|
30
|
+
<div class="nhsuk-grid-column-one-third">
|
|
31
|
+
<img class="app-hero__image" src="{{ params.image.src }}" alt="{{ params.image.alt }}"{% if not params.image.alt %} role="presentation"{% endif %}>
|
|
32
|
+
</div>
|
|
33
|
+
{% endif %}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@use "../../vendor/nhsuk-frontend" as *;
|
|
2
|
+
|
|
3
|
+
@include nhsuk-exports("nhsuk-eleventy-plugin/components/metadata") {
|
|
4
|
+
.app-metadata {
|
|
5
|
+
border-bottom: 1px solid $nhsuk-border-colour;
|
|
6
|
+
border-top: 1px solid $nhsuk-border-colour;
|
|
7
|
+
color: $nhsuk-secondary-text-colour;
|
|
8
|
+
margin-top: 0;
|
|
9
|
+
|
|
10
|
+
@include nhsuk-font($size: 16, $line-height: 1.5);
|
|
11
|
+
@include nhsuk-responsive-margin(7, "bottom");
|
|
12
|
+
@include nhsuk-responsive-padding(4, "bottom");
|
|
13
|
+
@include nhsuk-responsive-padding(4, "top");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.app-metadata__item {
|
|
17
|
+
display: flex;
|
|
18
|
+
gap: nhsuk-spacing(2) nhsuk-spacing(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.app-metadata__definition {
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
}
|