@x-govuk/govuk-eleventy-plugin 5.0.4 → 5.0.6

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
@@ -4,16 +4,16 @@ Build documentation websites using Markdown and GOV.UK styles.
4
4
 
5
5
  You’re welcome to use the plugin even if your service isn’t considered part of GOV.UK, but your site or service must not:
6
6
 
7
- * identify itself as being part of GOV.UK
8
- * use the crown or GOV.UK logotype in the header
9
- * use the GDS Transport typeface
10
- * suggest that it’s an official UK government website if it’s not
7
+ - identify itself as being part of GOV.UK
8
+ - use the crown or GOV.UK logotype in the header
9
+ - use the GDS Transport typeface
10
+ - suggest that it’s an official UK government website if it’s not
11
11
 
12
12
  ## Requirements
13
13
 
14
- * [Node.js](https://nodejs.org) v16.0.0 or above
15
- * [npm CLI](https://docs.npmjs.com/cli) v8.0.0 or above
16
- * [Eleventy](https://www.11ty.dev) v2.0.0 or above
14
+ - [Node.js](https://nodejs.org) v16.0.0 or above
15
+ - [npm CLI](https://docs.npmjs.com/cli) v8.0.0 or above
16
+ - [Eleventy](https://www.11ty.dev) v2.0.0 or above
17
17
 
18
18
  ## Installation
19
19
 
@@ -30,3 +30,12 @@ eleventyConfig.addPlugin(govukEleventyPlugin, {
30
30
  ```
31
31
 
32
32
  Learn more about how to [get started](https://x-govuk.github.io/govuk-eleventy-plugin/get-started/) and which [options you can provide](https://x-govuk.github.io/govuk-eleventy-plugin/options/).
33
+
34
+ ## Releasing a new version
35
+
36
+ `npm run release`
37
+
38
+ 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.
39
+
40
+ > ![NOTE]
41
+ > Releasing a new version requires permission to publish packages to the `@x-govuk` organisation.
@@ -38,8 +38,7 @@
38
38
  {%- if params.tags | length > 0 -%}
39
39
  <span aria-hidden="true">&ensp;•&ensp;</span>Tags:
40
40
  {%- for tag in params.tags %}
41
- {% set item = params.tagPages | includes("data.tag", tag) | first %}
42
- <a href="{{ item.url }}" class="govuk-link">{{ item.data.tag }}</a>
41
+ <a href="/tags/{{ tag | slug }}" class="govuk-link">{{ tag }}</a>
43
42
  {%- if not loop.last %}, {% endif %}
44
43
  {%- endfor -%}
45
44
  {%- endif -%}
@@ -13,7 +13,7 @@
13
13
  font-variant: all-small-caps;
14
14
  font-weight: normal;
15
15
  margin-left: govuk-spacing(1);
16
- opacity: .5;
16
+ opacity: 0.5;
17
17
  }
18
18
  }
19
19
 
@@ -34,11 +34,11 @@
34
34
  }
35
35
 
36
36
  sup {
37
- top: -.4em;
37
+ top: -0.4em;
38
38
  }
39
39
 
40
40
  sub {
41
- bottom: -.4em;
41
+ bottom: -0.4em;
42
42
  }
43
43
 
44
44
  img {
@@ -56,7 +56,7 @@
56
56
  // Show outline around linked images within figures
57
57
  img {
58
58
  display: block;
59
- outline: 1px solid rgba($govuk-border-colour, .5);
59
+ outline: 1px solid rgba($govuk-border-colour, 0.5);
60
60
  }
61
61
 
62
62
  > .govuk-link img {
@@ -115,7 +115,7 @@ $icon-size: 40px;
115
115
  }
116
116
 
117
117
  .app-site-search__menu--overlay {
118
- box-shadow: rgba(govuk-colour("black"), .25) 0 2px 6px;
118
+ box-shadow: rgba(govuk-colour("black"), 0.25) 0 2px 6px;
119
119
  left: 0;
120
120
  position: absolute;
121
121
  top: 100%;
package/index.js CHANGED
@@ -12,7 +12,6 @@ module.exports = function (eleventyConfig, pluginOptions = {}) {
12
12
  eleventyConfig.addCollection('ordered', require('./lib/collections/ordered.js'))
13
13
  eleventyConfig.addCollection('sitemap', require('./lib/collections/sitemap.js'))
14
14
  eleventyConfig.addCollection('tags', require('./lib/collections/tags.js'))
15
- eleventyConfig.addCollection('tagPages', require('./lib/collections/tag-pages.js'))
16
15
 
17
16
  // Extensions and template formats
18
17
  eleventyConfig.addExtension('scss', require('./lib/extensions/scss.js'))
package/layouts/post.njk CHANGED
@@ -16,8 +16,7 @@
16
16
  modified: modified,
17
17
  author: author,
18
18
  authors: authors,
19
- tags: tags,
20
- tagPages: collections.tagPages
19
+ tags: tags
21
20
  }) }}
22
21
  </div>
23
22
 
package/layouts/tags.njk CHANGED
@@ -15,10 +15,10 @@
15
15
  }) }}
16
16
 
17
17
  <ul class="govuk-list govuk-list--bullet">
18
- {% for item in collections.tagPages %}
18
+ {% for tag in collections.tags %}
19
19
  <li>
20
- <a href="{{ item.url | url }}">{{ item.data.tag }}</a>
21
- ({{ collections[item.data.tag] | length }})
20
+ <a href="/tags/{{ tag | slug }}">{{ tag }}</a>
21
+ ({{ collections[tag] | length }})
22
22
  </li>
23
23
  {% endfor %}
24
24
  </ul>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-govuk/govuk-eleventy-plugin",
3
- "version": "5.0.4",
3
+ "version": "5.0.6",
4
4
  "description": "Write documentation using Markdown and publish it using GOV.UK styles",
5
5
  "keywords": [
6
6
  "govuk",
@@ -36,10 +36,11 @@
36
36
  "predev": "rimraf _site",
37
37
  "dev": "eleventy --serve --watch",
38
38
  "start": "eleventy --serve",
39
- "lint": "standard && stylelint '**/*.scss'",
39
+ "lint": "prettier . --check && standard && stylelint '**/*.scss'",
40
40
  "test": "ava",
41
41
  "test:watch": "ava --watch",
42
- "coverage": "c8 ava"
42
+ "coverage": "c8 ava",
43
+ "release": "np"
43
44
  },
44
45
  "dependencies": {
45
46
  "@11ty/eleventy": "^2.0.0",
@@ -63,7 +64,7 @@
63
64
  "markdown-it-sup": "^1.0.0",
64
65
  "markdown-it-table-of-contents": "^0.6.0",
65
66
  "rimraf": "^5.0.0",
66
- "rollup": "^3.9.0",
67
+ "rollup": "^4.1.0",
67
68
  "sass": "^1.45.1",
68
69
  "smartypants": "^0.2.0"
69
70
  },
@@ -71,12 +72,14 @@
71
72
  "@x-govuk/govuk-eleventy-plugin": "file:./",
72
73
  "ava": "^5.1.0",
73
74
  "c8": "^8.0.0",
75
+ "np": "^8.0.4",
76
+ "prettier": "^3.0.0",
74
77
  "standard": "^17.0.0",
75
78
  "stylelint": "^ 15.10.3",
76
79
  "stylelint-config-gds": "^1.0.0"
77
80
  },
78
81
  "engines": {
79
- "node": "^16.0.0 || ^18.0.0",
82
+ "node": "^16 || ^18 || ^20",
80
83
  "npm": ">=8.0.0"
81
84
  },
82
85
  "publishConfig": {
@@ -88,6 +91,26 @@
88
91
  "lcovonly"
89
92
  ]
90
93
  },
94
+ "prettier": {
95
+ "semi": false,
96
+ "singleQuote": true,
97
+ "trailingComma": "none",
98
+ "overrides": [
99
+ {
100
+ "files": "*.md",
101
+ "options": {
102
+ "embeddedLanguageFormatting": "off",
103
+ "singleQuote": false
104
+ }
105
+ },
106
+ {
107
+ "files": "*.scss",
108
+ "options": {
109
+ "singleQuote": false
110
+ }
111
+ }
112
+ ]
113
+ },
91
114
  "stylelint": {
92
115
  "extends": "stylelint-config-gds/scss"
93
116
  }
@@ -1,2 +0,0 @@
1
- module.exports = (collection) =>
2
- collection.getAllSorted().filter((item) => item.data.layout === 'tag')