@x-govuk/govuk-eleventy-plugin 6.4.2 → 6.6.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.
@@ -53,20 +53,22 @@
53
53
  <span class="govuk-footer__licence-description">
54
54
  {{ params.contentLicence.html | safe if params.contentLicence.html else params.contentLicence.text }}
55
55
  </span>
56
- {% else %}
56
+ {% elseif params.contentLicence != false %}
57
57
  {% include "./_ogl.svg" %}
58
58
  <span class="govuk-footer__licence-description">
59
59
  All content is available under the <a class="govuk-footer__link" href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">Open Government Licence v3.0</a>, except where otherwise stated
60
60
  </span>
61
61
  {% endif %}
62
62
  </div>
63
- <div class="govuk-footer__meta-item">
64
- {%- if params.copyright.html or params.copyright.text -%}
65
- {{ params.copyright.html | safe if params.copyright.html else params.copyright.text }}
66
- {% else %}
67
- <a class="govuk-footer__link govuk-footer__copyright-logo" href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/">©&nbsp;Crown copyright</a>
63
+ {%- if params.copyright != false -%}
64
+ <div class="govuk-footer__meta-item">
65
+ {%- if params.copyright.html or params.copyright.text -%}
66
+ {{ params.copyright.html | safe if params.copyright.html else params.copyright.text }}
67
+ {% else %}
68
+ <a class="govuk-footer__link govuk-footer__copyright-logo" href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/">©&nbsp;Crown copyright</a>
69
+ {% endif %}
70
+ </div>
68
71
  {% endif %}
69
- </div>
70
72
  </div>
71
73
  </div>
72
74
  </footer>
@@ -2,10 +2,6 @@
2
2
  // See: https://github.com/alphagov/govuk-design-system/blob/master/src/stylesheets/components/_header.scss
3
3
 
4
4
  @include govuk-exports("app-header") {
5
- .app-header--full-width-border {
6
- border-bottom: $govuk-border-width-wide solid $govuk-brand-colour;
7
- }
8
-
9
5
  .app-header--no-border {
10
6
  border-bottom: 0;
11
7
  }
@@ -1,10 +1,10 @@
1
1
  {%- from "../site-search/macro.njk" import appSiteSearch -%}
2
2
  {%- if options.navigation -%}
3
- {%- set headerType = "full-width-border" -%}
3
+ {%- set headerClasses = " govuk-header--full-width-border" -%}
4
4
  {% elif layout == "product" or layout == "collection" %}
5
- {%- set headerType = "no-border" -%}
5
+ {%- set headerClasses = " app-header--no-border" -%}
6
6
  {%- endif -%}
7
- <header class="govuk-header app-header{% if headerType %} app-header--{{ headerType }}{% endif %}" role="banner" data-module="govuk-header">
7
+ <header class="govuk-header app-header{{ headerClasses }}" role="banner" data-module="govuk-header">
8
8
  <div class="govuk-header__container govuk-width-container app-header__container">
9
9
  <div class="govuk-header__logo app-header__logo">
10
10
  <a href="{{ params.homepageUrl | default("/") }}" class="govuk-header__link govuk-header__link--homepage">
@@ -1,4 +1,4 @@
1
- <site-search class="app-site-search govuk-!-display-none-print" index="{{ params.indexPath | htmlBaseUrl }}" label="{{ params.label | default("Search site") }}">
1
+ <site-search class="app-site-search govuk-!-display-none-print" index="{{ params.indexPath | canonicalUrl }}" label="{{ params.label | default("Search site") }}">
2
2
  {%- if params.sitemapPath -%}
3
3
  <a class="app-site-search__link" href="{{ params.sitemapPath }}">Sitemap</a>
4
4
  {%- endif -%}
package/layouts/base.njk CHANGED
@@ -21,9 +21,9 @@
21
21
  {# Components #}
22
22
  {% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}
23
23
  {% from "govuk/components/pagination/macro.njk" import govukPagination %}
24
+ {% from "govuk/components/service-navigation/macro.njk" import govukServiceNavigation %}
24
25
 
25
26
  {% from "x-govuk/components/masthead/macro.njk" import xGovukMasthead %}
26
- {% from "x-govuk/components/primary-navigation/macro.njk" import xGovukPrimaryNavigation %}
27
27
  {% from "x-govuk/components/related-navigation/macro.njk" import xGovukRelatedNavigation %}
28
28
  {% from "x-govuk/components/sub-navigation/macro.njk" import xGovukSubNavigation %}
29
29
 
@@ -65,9 +65,9 @@
65
65
 
66
66
  {% block header %}
67
67
  {{ appHeader(options.header) }}
68
- {{ xGovukPrimaryNavigation({
69
- visuallyHiddenTitle: options.navigation.visuallyHiddenTitle,
70
- items: options.navigation.items | currentPage(page.url)
68
+ {{ govukServiceNavigation({
69
+ navigationLabel: options.navigation.visuallyHiddenTitle,
70
+ navigation: options.navigation.items | currentPage(page.url)
71
71
  }) if options.navigation }}
72
72
  {% endblock %}
73
73
 
@@ -6,14 +6,19 @@ const path = require('node:path')
6
6
  * @returns {string} Canonical site URL with resolved path
7
7
  */
8
8
  module.exports = function (string = '') {
9
- const { url } = this.ctx.options
9
+ const { options } = this.ctx
10
+
11
+ // No site URL configured
12
+ if (!options?.url) {
13
+ return string
14
+ }
10
15
 
11
16
  // If plugin options do not provide a site URL, return the path
12
- if (!URL.canParse(url)) {
17
+ if (!URL.canParse(options.url)) {
13
18
  return string
14
19
  }
15
20
 
16
- const siteUrl = new URL(url)
21
+ const siteUrl = new URL(options.url)
17
22
 
18
23
  // If incoming string is a URL, return that if it’s an external URL
19
24
  if (URL.canParse(string)) {
@@ -6,7 +6,7 @@
6
6
  */
7
7
  module.exports = (array, pageUrl) => {
8
8
  return array.map((item) => {
9
- item.current =
9
+ item.active =
10
10
  item.href === '/'
11
11
  ? pageUrl === '/' // Page is home page
12
12
  : pageUrl.startsWith(item.href) // Page is within navigation section
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-govuk/govuk-eleventy-plugin",
3
- "version": "6.4.2",
3
+ "version": "6.6.0",
4
4
  "description": "Write documentation using Markdown and publish it using GOV.UK styles",
5
5
  "keywords": [
6
6
  "govuk",
@@ -59,7 +59,7 @@
59
59
  "@rollup/plugin-node-resolve": "^15.0.0",
60
60
  "@x-govuk/govuk-prototype-components": "^3.0.0",
61
61
  "deepmerge": "^4.2.2",
62
- "govuk-frontend": "^5.0.0",
62
+ "govuk-frontend": "^5.6.0",
63
63
  "luxon": "^3.0.1",
64
64
  "markdown-it-abbr": "^2.0.0",
65
65
  "markdown-it-anchor": "^9.0.0",
@@ -71,7 +71,7 @@
71
71
  "markdown-it-mark": "^4.0.0",
72
72
  "markdown-it-sub": "^2.0.0",
73
73
  "markdown-it-sup": "^2.0.0",
74
- "markdown-it-table-of-contents": "^0.6.0",
74
+ "markdown-it-table-of-contents": "^0.8.0",
75
75
  "rimraf": "^5.0.0",
76
76
  "rollup": "^4.1.0",
77
77
  "sass": "^1.45.1",