@x-govuk/govuk-eleventy-plugin 6.7.0 → 6.7.2

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.
@@ -1,4 +1,4 @@
1
- {%- from "../site-search/macro.njk" import appSiteSearch -%}
1
+ {%- from "components/site-search/macro.njk" import appSiteSearch with context -%}
2
2
  {%- if options.navigation -%}
3
3
  {%- set headerClasses = " govuk-header--full-width-border" -%}
4
4
  {% elif layout == "product" or layout == "collection" %}
package/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  const { EleventyHtmlBasePlugin } = require('@11ty/eleventy')
2
2
 
3
+ const addCollections = require('./lib/collections/index.js')
4
+
3
5
  module.exports = function (eleventyConfig, pluginOptions = {}) {
4
6
  const { pathPrefix } = eleventyConfig
5
7
 
@@ -11,16 +13,7 @@ module.exports = function (eleventyConfig, pluginOptions = {}) {
11
13
  eleventyConfig.setLibrary('njk', require('./lib/nunjucks.js')(eleventyConfig))
12
14
 
13
15
  // Collections
14
- eleventyConfig.addCollection('all', require('./lib/collections/all.js'))
15
- eleventyConfig.addCollection(
16
- 'ordered',
17
- require('./lib/collections/ordered.js')
18
- )
19
- eleventyConfig.addCollection(
20
- 'sitemap',
21
- require('./lib/collections/sitemap.js')
22
- )
23
- eleventyConfig.addCollection('tags', require('./lib/collections/tags.js'))
16
+ addCollections(eleventyConfig)
24
17
 
25
18
  // Extensions and template formats
26
19
  eleventyConfig.addExtension('scss', require('./lib/extensions/scss.js'))
package/layouts/base.njk CHANGED
@@ -35,9 +35,9 @@
35
35
  {% from "components/prose-scope/macro.njk" import appProseScope %}
36
36
 
37
37
  {% block headIcons %}
38
- <link rel="shortcut icon" sizes="16x16 32x32 48x48" href="{{ options.icons.shortcut }}" type="image/x-icon">
39
- <link rel="mask-icon" href="{{ options.icons.mask }}" color="{{ themeColor }}">
40
- <link rel="apple-touch-icon" href="{{ options.icons.touch }}">
38
+ {%- if options.icons.shortcut %}<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="{{ options.icons.shortcut }}" type="image/x-icon">{% endif %}
39
+ {%- if options.icons.mask %}<link rel="mask-icon" href="{{ options.icons.mask }}" color="{{ themeColor }}">{% endif %}
40
+ {%- if options.icons.touch %}<link rel="apple-touch-icon" href="{{ options.icons.touch }}">{% endif %}
41
41
  {% endblock %}
42
42
 
43
43
  {% block head %}
@@ -11,7 +11,7 @@
11
11
  <div class="govuk-grid-row">
12
12
  <div class="govuk-grid-column-one-quarter-from-desktop">
13
13
  {{ xGovukSubNavigation({
14
- items: collections.ordered | eleventyNavigation(sectionKey or options.homeKey) | itemsFromNavigation(page.url, { pathPrefix: options.pathPrefix })
14
+ items: collections.navigation | eleventyNavigation(sectionKey or options.homeKey) | itemsFromNavigation(page.url, { pathPrefix: options.pathPrefix })
15
15
  }) }}
16
16
  </div>
17
17
  <div class="govuk-grid-column-three-quarters-from-desktop">
@@ -0,0 +1,17 @@
1
+ module.exports = function (eleventyConfig) {
2
+ if (!eleventyConfig.collections.all) {
3
+ eleventyConfig.addCollection('all', require('./all.js'))
4
+ }
5
+
6
+ if (!eleventyConfig.collections.navigation) {
7
+ eleventyConfig.addCollection('navigation', require('./navigation.js'))
8
+ }
9
+
10
+ if (!eleventyConfig.collections.sitemap) {
11
+ eleventyConfig.addCollection('sitemap', require('./sitemap.js'))
12
+ }
13
+
14
+ if (!eleventyConfig.collections.tag) {
15
+ eleventyConfig.addCollection('tags', require('./tags.js'))
16
+ }
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-govuk/govuk-eleventy-plugin",
3
- "version": "6.7.0",
3
+ "version": "6.7.2",
4
4
  "description": "Write documentation using Markdown and publish it using GOV.UK styles",
5
5
  "keywords": [
6
6
  "govuk",
@@ -56,7 +56,7 @@
56
56
  "@11ty/eleventy-navigation": "^0.3.2",
57
57
  "@11ty/eleventy-plugin-rss": "^1.0.0",
58
58
  "@rollup/plugin-commonjs": "^28.0.0",
59
- "@rollup/plugin-node-resolve": "^15.0.0",
59
+ "@rollup/plugin-node-resolve": "^16.0.0",
60
60
  "@x-govuk/govuk-prototype-components": "^3.0.0",
61
61
  "deepmerge": "^4.2.2",
62
62
  "govuk-frontend": "^5.6.0",
File without changes