diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9551f08f..18330060 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -46,5 +46,5 @@ jobs: run: | (cd tests/utils && nohup python -m flask run --port 3000 &) wait-for-it localhost:3000 - ./govuk-frontend-diff http://localhost:3000 --govuk-frontend-version=v5.1.0 --exclude page-template --ci + ./govuk-frontend-diff http://localhost:3000 --govuk-frontend-version=v5.4.0 --exclude page-template --ci diff --git a/CHANGELOG.md b/CHANGELOG.md index 21f870bd..802973d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/LandRegistry/govuk-frontend-jinja/compare/3.0.0...main) +## [Unreleased](https://github.com/LandRegistry/govuk-frontend-jinja/compare/3.1.0...main) + +## [3.1.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.1.0) - 28/05/2024 + +### Added + +- [GOV.UK Frontend v5.4.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.4.0) support ## [3.0.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.0.0) - 08/02/2024 diff --git a/README.md b/README.md index bdd13fe6..cb7f83b0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GOV.UK Frontend Jinja Macros [](https://pypi.org/project/govuk-frontend-jinja/) - + [](https://github.com/LandRegistry/govuk-frontend-jinja/actions/workflows/python-package.yml) **GOV.UK Frontend Jinja is a [community tool](https://design-system.service.gov.uk/community/resources-and-tools/) of the [GOV.UK Design System](https://design-system.service.gov.uk/). The Design System team is not responsible for it and cannot support you with using it. Contact the [maintainers](#contributors) directly if you need [help](#support) or you want to request a feature.** @@ -16,6 +16,7 @@ The following table shows the version of GOV.UK Frontend Jinja that you should u | GOV.UK Frontend Jinja Version | Target GOV.UK Frontend Version | | ----------------------------- | ------------------------------ | +| [3.1.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.1.0) | [5.4.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.4.0) | | [3.0.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.0.0) | [5.1.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.1.0) | | [2.8.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/2.8.0) | [4.8.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.8.0) | | [2.7.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/2.7.0) | [4.7.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.7.0) | diff --git a/govuk_frontend_jinja/templates/components/accordion/macro.html b/govuk_frontend_jinja/templates/components/accordion/macro.html index b3b44d52..3fa1f2aa 100644 --- a/govuk_frontend_jinja/templates/components/accordion/macro.html +++ b/govuk_frontend_jinja/templates/components/accordion/macro.html @@ -1,4 +1,5 @@ {% macro govukAccordion(params) %} +{% from "govuk_frontend_jinja/macros/attributes.html" import govukAttributes %} {% from "govuk_frontend_jinja/macros/i18n.html" import govukI18nAttributes %} {%- macro _accordionItem(params, item, index) %} @@ -60,7 +61,7 @@ }) -}} {%- if params.rememberExpanded is not undefined %} data-remember-expanded="{{ params.rememberExpanded | escape | lower }}"{% endif %} - {%- for attribute, value in (params.attributes.items() if params.attributes else {}.items()) %} {{ attribute }}="{{ value }}"{% endfor %}> + {{- govukAttributes(params.attributes) }}> {% for item in params['items'] %} {% if item %}{{ _accordionItem(params, item, loop.index) }}{% endif %} {% endfor %} diff --git a/govuk_frontend_jinja/templates/components/back-link/macro.html b/govuk_frontend_jinja/templates/components/back-link/macro.html index cac39ca9..f89e4e8e 100644 --- a/govuk_frontend_jinja/templates/components/back-link/macro.html +++ b/govuk_frontend_jinja/templates/components/back-link/macro.html @@ -1,4 +1,8 @@ {% macro govukBackLink(params) %} +{% from "govuk_frontend_jinja/macros/attributes.html" import govukAttributes -%} + {{ (params.html | safe if params.html else (params.text if params.text else 'Back')) }} + {{- govukAttributes(params.attributes) }}> + {{- params.html | safe if params.html else (params.text if params.text else "Back") -}} + {% endmacro %} diff --git a/govuk_frontend_jinja/templates/components/breadcrumbs/macro.html b/govuk_frontend_jinja/templates/components/breadcrumbs/macro.html index b1ddf544..1fc37155 100644 --- a/govuk_frontend_jinja/templates/components/breadcrumbs/macro.html +++ b/govuk_frontend_jinja/templates/components/breadcrumbs/macro.html @@ -1,21 +1,23 @@ {% macro govukBreadcrumbs(params) %} -{# Set classes for this component #} +{% from "govuk_frontend_jinja/macros/attributes.html" import govukAttributes %} + +{#- Set classes for this component #} {%- set classNames = "govuk-breadcrumbs" -%} {% if params.classes %} - {% set classNames = classNames + " " + params.classes %} + {% set classNames = classNames ~ " " ~ params.classes %} {% endif -%} {% if params.collapseOnMobile %} - {% set classNames = classNames + " govuk-breadcrumbs--collapse-on-mobile" %} + {% set classNames = classNames ~ " govuk-breadcrumbs--collapse-on-mobile" %} {% endif -%} -