@x-govuk/nhsuk-eleventy-plugin 1.0.5 → 1.1.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 CHANGED
@@ -23,7 +23,7 @@ export default function(eleventyConfig) {
23
23
  }
24
24
  ```
25
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/).
26
+ Learn more about how to [get started](https://nhsuk-eleventy-plugin.x-govuk.org/get-started/) and which [options you can provide](https://nhsuk-eleventy-plugin.x-govuk.org/get-started/options/).
27
27
 
28
28
  ## Releasing a new version
29
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-govuk/nhsuk-eleventy-plugin",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "description": "Write documentation using Markdown and publish it using NHS.UK styles",
5
5
  "keywords": [
6
6
  "nhsuk",
@@ -8,7 +8,7 @@
8
8
  "eleventy",
9
9
  "eleventy-plugin"
10
10
  ],
11
- "homepage": "https://x-govuk.github.io/nhsuk-eleventy-plugin/",
11
+ "homepage": "https://nhsuk-eleventy-plugin.x-govuk.org",
12
12
  "bugs": {
13
13
  "url": "git+https://github.com/x-govuk/nhsuk-eleventy-plugin/issues"
14
14
  },
@@ -54,10 +54,10 @@
54
54
  "dependencies": {
55
55
  "@11ty/eleventy": "^3.0.0",
56
56
  "@11ty/eleventy-navigation": "^1.0.0",
57
- "@rollup/plugin-commonjs": "^28.0.0",
57
+ "@rollup/plugin-commonjs": "^29.0.0",
58
58
  "@rollup/plugin-node-resolve": "^16.0.0",
59
59
  "@rollup/plugin-terser": "^0.4.4",
60
- "@x-govuk/govuk-eleventy-plugin": "^8.0.4",
60
+ "@x-govuk/govuk-eleventy-plugin": "^8.1.1",
61
61
  "accessible-autocomplete": "^3.0.1",
62
62
  "deepmerge": "^4.2.2",
63
63
  "markdown-it-abbr": "^2.0.0",
@@ -67,21 +67,21 @@
67
67
  "markdown-it-deflist": "^3.0.0",
68
68
  "markdown-it-footnote": "^4.0.0",
69
69
  "markdown-it-github-alerts": "^1.0.0",
70
- "markdown-it-govuk": "^0.7.0",
70
+ "markdown-it-govuk": "^0.8.0",
71
71
  "markdown-it-image-figures": "^2.0.0",
72
72
  "markdown-it-ins": "^4.0.0",
73
73
  "markdown-it-mark": "^4.0.0",
74
74
  "markdown-it-sub": "^2.0.0",
75
75
  "markdown-it-sup": "^2.0.0",
76
76
  "markdown-it-table-of-contents": "^1.0.0",
77
- "nhsuk-frontend": "^10.0.0",
77
+ "nhsuk-frontend": "^10.3.0",
78
78
  "rollup": "^4.1.0",
79
79
  "sass": "^1.45.1"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@x-govuk/eslint-config": "^0.0.1",
83
83
  "@x-govuk/nhsuk-eleventy-plugin": "file:./",
84
- "np": "^10.0.0",
84
+ "np": "^11.0.0",
85
85
  "prettier": "^3.1.0",
86
86
  "stylelint": "^16.0.0",
87
87
  "stylelint-config-gds": "^2.0.0",
@@ -1,8 +1,8 @@
1
1
  @forward "attribution";
2
- @forward "blockquote";
3
2
  @forward "code";
4
3
  @forward "contents-list";
5
4
  @forward "footnotes-list";
5
+ @forward "govspeak";
6
6
  @forward "hero";
7
7
  @forward "image";
8
8
  @forward "metadata";
@@ -14,12 +14,11 @@
14
14
  primary: params.type == "primary",
15
15
  secondary: params.type == "secondary",
16
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 ""),
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
18
  headingLevel: 3 if params.title else 2,
19
19
  href: item.href,
20
20
  descriptionHtml: item.descriptionHtml,
21
- imgALT: item.imgALT,
22
- imgURL: item.imgURL
21
+ image: item.image
23
22
  }) | indent(4) }}
24
23
  </li>
25
24
  {% endfor %}
@@ -0,0 +1,31 @@
1
+ @use "../../vendor/nhsuk-frontend" as *;
2
+
3
+ @include nhsuk-exports("nhsuk-eleventy-plugin/components/govspeak") {
4
+ // Information callout
5
+ // https://components.publishing.service.gov.uk/component-guide/govspeak/information_callout
6
+ [data-govspeak="information-callout"] {
7
+ @extend .nhsuk-inset-text;
8
+ }
9
+
10
+ // Blockquote
11
+ // https://components.publishing.service.gov.uk/component-guide/govspeak/blockquote
12
+ // https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss
13
+ blockquote[data-govspeak="blockquote"] {
14
+ margin: 0 0 nhsuk-spacing(4);
15
+ padding: 0 0 0 nhsuk-spacing(6);
16
+
17
+ p {
18
+ position: relative;
19
+
20
+ &::before {
21
+ content: "\201C";
22
+ position: absolute;
23
+ right: 100%;
24
+ }
25
+
26
+ &:last-of-type::after {
27
+ content: "\201D";
28
+ }
29
+ }
30
+ }
31
+ }
@@ -3,7 +3,7 @@ import deepmerge from 'deepmerge'
3
3
  /**
4
4
  * Default option values
5
5
  *
6
- * @see {@link https://x-govuk.github.io/nhsuk-eleventy-plugin/options/}
6
+ * @see {@link https://nhsuk-eleventy-plugin.x-govuk.org/options/}
7
7
  */
8
8
  const defaults = {
9
9
  homeKey: 'Home',
@@ -70,8 +70,7 @@ export function itemsFromCollection(array, n) {
70
70
  ...(item.caption && { caption: item.caption }),
71
71
  heading: smart(item.title),
72
72
  descriptionHtml: getDescriptionHtml(item),
73
- ...(item.image && { imgURL: item.image.src }),
74
- ...(item.image && { imgALT: item.image.alt })
73
+ ...(item.image && { image: item.image })
75
74
  }))
76
75
 
77
76
  return sliceFromCollection(array, n)
@@ -43,6 +43,7 @@ export function md(markdownOptions = {}) {
43
43
  .use(markdownItGovuk, {
44
44
  brand: 'nhsuk',
45
45
  calvert: true,
46
+ govspeak: ['blockquote', 'information-callout'],
46
47
  headingsStartWith: markdownOptions.headingsStartWith
47
48
  })
48
49
  .use(markdownItAbbr)
@@ -1,22 +0,0 @@
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
- }