diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml index c2a4481ba5..9fd17a1ba8 100644 --- a/.github/workflows/lighthouse-ci.yml +++ b/.github/workflows/lighthouse-ci.yml @@ -12,13 +12,10 @@ jobs: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} - - name: Read .nvmrc file - id: read-nvmrc-file - run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Install Node uses: actions/setup-node@v3 with: - node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" + node-version-file: ".nvmrc" - name: Install dependencies run: yarn install - name: Build pages diff --git a/.github/workflows/macro-and-script-tests.yml b/.github/workflows/macro-and-script-tests.yml index 5f20c4c1fb..0220d89974 100644 --- a/.github/workflows/macro-and-script-tests.yml +++ b/.github/workflows/macro-and-script-tests.yml @@ -12,13 +12,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Read .nvmrc file - id: read-nvmrc-file - run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Install Node uses: actions/setup-node@v3 with: - node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" + node-version-file: ".nvmrc" - name: Install dependencies run: yarn install - name: Run macro and script tests diff --git a/.github/workflows/npm-bundle.yml b/.github/workflows/npm-bundle.yml index 2dc0b4faa7..12631cbc70 100644 --- a/.github/workflows/npm-bundle.yml +++ b/.github/workflows/npm-bundle.yml @@ -10,9 +10,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Read .nvmrc file - id: read-nvmrc-file - run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Use Node.js uses: actions/checkout@v3 with: @@ -20,7 +17,7 @@ jobs: - name: Install Node uses: actions/setup-node@v3 with: - node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" + node-version-file: ".nvmrc" registry-url: https://registry.npmjs.org/ - run: yarn install - run: git config --global user.name "${{ github.actor }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a50c3eb18..c8db6937f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,13 +8,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Read .nvmrc file - id: read-nvmrc-file - run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Install Node uses: actions/setup-node@v3 with: - node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" + node-version-file: ".nvmrc" - name: Install dependencies run: yarn install - name: Build templates diff --git a/.github/workflows/visual-regression-tests.yml b/.github/workflows/visual-regression-tests.yml index be5864b1e7..3d2cf558cb 100644 --- a/.github/workflows/visual-regression-tests.yml +++ b/.github/workflows/visual-regression-tests.yml @@ -15,13 +15,10 @@ jobs: with: lfs: true url: https://github.com/ONSdigital/design-system.git - - name: Read .nvmrc file - id: read-nvmrc-file - run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Install Node uses: actions/setup-node@v3 with: - node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" + node-version-file: ".nvmrc" - name: Install dependencies run: yarn install - name: Install Docker diff --git a/src/components/accordion/example-accordion-open.njk b/src/components/accordion/example-accordion-open.njk index e2cf45ec88..a276c18769 100644 --- a/src/components/accordion/example-accordion-open.njk +++ b/src/components/accordion/example-accordion-open.njk @@ -62,7 +62,7 @@ "text": "Areas (0)" }, "value": "areas" - } + } ] }) }} @@ -98,7 +98,7 @@ "text": "Disability (67)" }, "value": "disability" - } + } ] }) }} diff --git a/src/components/checkboxes/_macro.njk b/src/components/checkboxes/_macro.njk index 933838c4b4..8fbef54388 100644 --- a/src/components/checkboxes/_macro.njk +++ b/src/components/checkboxes/_macro.njk @@ -7,7 +7,7 @@ {% set fields %} {% if params.checkboxesLabel is defined %}

{{ params.checkboxesLabel }}

- {% endif %} + {% endif %} {% set hasOther = false %} {% for checkbox in params.checkboxes %} {% if checkbox.other %} diff --git a/src/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk b/src/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk index 7bc0cfa595..d34ea82bfd 100644 --- a/src/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +++ b/src/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk @@ -82,7 +82,7 @@ "text": "Areas (0)" }, "value": "areas" - } + } ] }) }} diff --git a/src/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk b/src/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk index f31021a79e..fe2c463062 100644 --- a/src/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +++ b/src/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk @@ -80,7 +80,7 @@ "text": "Areas (0)" }, "value": "areas" - } + } ] }) }} diff --git a/src/components/footer/_macro.njk b/src/components/footer/_macro.njk index ed7412ff87..38cd41d0e0 100644 --- a/src/components/footer/_macro.njk +++ b/src/components/footer/_macro.njk @@ -179,7 +179,7 @@ {% endif %} {% if params.copyrightDeclaration %} -
+
diff --git a/src/components/label/_macro.njk b/src/components/label/_macro.njk index c1b4e818f4..678fe2c8bb 100644 --- a/src/components/label/_macro.njk +++ b/src/components/label/_macro.njk @@ -1,8 +1,8 @@ {% macro onsLabel(params) %} {% if params.id %} - {% set descriptionID = params.id ~ "-description-hint" %} + {% set descriptionID = params.id ~ "-description-hint" %} {% else %} - {% set descriptionID = "description-hint" %} + {% set descriptionID = "description-hint" %} {% endif %} {% if params.inputType == "checkbox" or params.inputType == "radio" %} diff --git a/src/components/related-content/_macro.njk b/src/components/related-content/_macro.njk index 714e4fcb85..51fd775e27 100644 --- a/src/components/related-content/_macro.njk +++ b/src/components/related-content/_macro.njk @@ -1,36 +1,34 @@ {% macro onsRelatedContent(params) %} - {% if params.classes %} - {% set classes = ' ' + params.classes %} - {% endif %} + {% if params.classes %} + {% set classes = ' ' + params.classes %} + {% endif %} - + {% for row in params.rows %} + {% call onsRelatedContentSection({ + "title": row.title, + "id": row.id + }) %} + + {% endcall %} + {% endfor %} + {% else %} + {{ caller() if caller }} + {% endif %} + {% endmacro %} diff --git a/src/components/section-navigation/_macro.njk b/src/components/section-navigation/_macro.njk index 65f2e040a3..9245295ce1 100644 --- a/src/components/section-navigation/_macro.njk +++ b/src/components/section-navigation/_macro.njk @@ -1,59 +1,60 @@ {% macro onsSectionNavigation(params) %} - {% endmacro %} diff --git a/src/components/video/_macro.njk b/src/components/video/_macro.njk index da22fc20c0..1266e058a7 100644 --- a/src/components/video/_macro.njk +++ b/src/components/video/_macro.njk @@ -2,20 +2,20 @@ {%- macro onsVideo(params) -%} {% set linkContents %} - {% if params.image.smallSrc %} - {{ params.image.alt }} - {% endif %} - {{ params.linkText }} + {% if params.image.smallSrc %} + {{ params.image.alt }} + {% endif %} + {{ params.linkText }} {% endset %}
- {{ - onsExternalLink({ - "url": params.videoLinkURL, - "classes": "ons-video__link ons-js-video-placeholder ons-u-db", - "linkText": linkContents - }) - }} + {{ + onsExternalLink({ + "url": params.videoLinkURL, + "classes": "ons-video__link ons-js-video-placeholder ons-u-db", + "linkText": linkContents + }) + }}
{%- endmacro -%} diff --git a/src/layout/_template.njk b/src/layout/_template.njk index b5ca6fda6b..7e429f7292 100644 --- a/src/layout/_template.njk +++ b/src/layout/_template.njk @@ -138,29 +138,29 @@ {% endblock %} {% block header %} {{ - onsHeader({ - "wide": pageConfig.wide, - "fullWidth": pageConfig.fullWidth, - "language": pageConfig.header.language, - "button": pageConfig.header.signoutButton, - "toggleNavigationButton": pageConfig.header.toggleNavigationButton, - "navigation": pageConfig.header.navigation, - "siteSearchAutosuggest": pageConfig.header.siteSearchAutosuggest, - "browserBanner": pageConfig.header.browserBanner, - "phase": pageConfig.header.phase, - "assetsURL": assetsURL, - "serviceLinks": pageConfig.header.serviceLinks, - "variants": pageConfig.header.variants, - "classes": pageConfig.header.classes, - "mastheadLogo": pageConfig.header.mastheadLogo, - "mastheadLogoUrl": pageConfig.header.mastheadLogoUrl, - "titleUrl": pageConfig.header.titleUrl, - "title": pageConfig.header.title | default(pageConfig.title), - "description": pageConfig.header.description, - "titleAsH1": pageConfig.header.titleAsH1, - "titleLogo": pageConfig.header.titleLogo - }) - }} + onsHeader({ + "wide": pageConfig.wide, + "fullWidth": pageConfig.fullWidth, + "language": pageConfig.header.language, + "button": pageConfig.header.signoutButton, + "toggleNavigationButton": pageConfig.header.toggleNavigationButton, + "navigation": pageConfig.header.navigation, + "siteSearchAutosuggest": pageConfig.header.siteSearchAutosuggest, + "browserBanner": pageConfig.header.browserBanner, + "phase": pageConfig.header.phase, + "assetsURL": assetsURL, + "serviceLinks": pageConfig.header.serviceLinks, + "variants": pageConfig.header.variants, + "classes": pageConfig.header.classes, + "mastheadLogo": pageConfig.header.mastheadLogo, + "mastheadLogoUrl": pageConfig.header.mastheadLogoUrl, + "titleUrl": pageConfig.header.titleUrl, + "title": pageConfig.header.title | default(pageConfig.title), + "description": pageConfig.header.description, + "titleAsH1": pageConfig.header.titleAsH1, + "titleLogo": pageConfig.header.titleLogo + }) + }} {% endblock %} {% block pageContent %}
@@ -168,12 +168,12 @@ {% if pageConfig.breadcrumbs %} {% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %} {{ - onsBreadcrumbs({ - "id": pageConfig.breadcrumbs.id, - "ariaLabel": pageConfig.breadcrumbs.ariaLabel, - "itemsList": pageConfig.breadcrumbs.itemsList - }) - }} + onsBreadcrumbs({ + "id": pageConfig.breadcrumbs.id, + "ariaLabel": pageConfig.breadcrumbs.ariaLabel, + "itemsList": pageConfig.breadcrumbs.itemsList + }) + }} {% endif %} {% endblock %}
diff --git a/src/patterns/guide/example-guide-overview.njk b/src/patterns/guide/example-guide-overview.njk index 97879446b6..1b0eebc2ed 100644 --- a/src/patterns/guide/example-guide-overview.njk +++ b/src/patterns/guide/example-guide-overview.njk @@ -90,17 +90,34 @@ layout: ~ ] }) }} -

What the census is

The census is a survey that happens every 10 years and gives us a picture of all the people and households in England and Wales. The census is unique. There’s simply nothing else that gives so much detail about us and the society we live in.

All kinds of organisations, from local authorities to charities, use the information to help provide the services we all need, including transport, education and healthcare. Without the census, it would be much more difficult to do this.

By taking part, you’ll be helping make sure you and your community get the services needed now and in the future.

Past, present and future

The first census was in 1801 and the most recent in 2011. The Office for National Statistics (ONS) runs the census in England Wales and the next one will happen on Sunday 21 March 2021. To prepare for it, we held a census rehearsal in 2019 to check our processes, systems and services were running smoothly ahead of the real thing.

Between censuses

We also need your help between each census. At the ONS, we rely on ongoing surveys to provide detailed, up-to-date information about changes to society. To make sure that we represent everyone, we ask people to take part in these surveys. We carry out interviews in person, by phone or online.

These surveys do not stop while the census takes place. To find out more about the types of surveys we run throughout the year, visit the ONS website.

The census in Scotland and Northern Ireland

At the ONS, we’re responsible for planning and running the census for England and Wales.

Find out more about the censuses in Scotland and Northern Ireland from National Records of Scotland and Northern Ireland Statistics and Research Agency.

+
+

What the census is

+

The census is a survey that happens every 10 years and gives us a picture of all the people and households in England and Wales. The census is unique. There’s simply nothing else that gives so much detail about us and the society we live in.

+

All kinds of organisations, from local authorities to charities, use the information to help provide the services we all need, including transport, education and healthcare. Without the census, it would be much more difficult to do this.

+

By taking part, you’ll be helping make sure you and your community get the services needed now and in the future.

+ +

Past, present and future

+

The first census was in 1801 and the most recent in 2011. The Office for National Statistics (ONS) runs the census in England Wales and the next one will happen on Sunday 21 March 2021. To prepare for it, we held a census rehearsal in 2019 to check our processes, systems and services were running smoothly ahead of the real thing.

+ +

Between censuses

+

We also need your help between each census. At the ONS, we rely on ongoing surveys to provide detailed, up-to-date information about changes to society. To make sure that we represent everyone, we ask people to take part in these surveys. We carry out interviews in person, by phone or online.

+

These surveys do not stop while the census takes place. To find out more about the types of surveys we run throughout the year, visit the ONS website.

+ +

The census in Scotland and Northern Ireland

+

At the ONS, we’re responsible for planning and running the census for England and Wales.

+ +

Find out more about the censuses in Scotland and Northern Ireland from National Records of Scotland and Northern Ireland Statistics and Research Agency.

+
{{- - onsContentPagination({ - "contentPaginationItems": [ - { - "rel": 'next', - "text": 'Next', - "url": '#', - "label": 'Who should take part and why' - } + onsContentPagination({ + "contentPaginationItems": [ + { + "rel": 'next', + "text": 'Next', + "url": '#', + "label": 'Who should take part and why' + } ] }) }} diff --git a/src/patterns/guide/example-guide.njk b/src/patterns/guide/example-guide.njk index 890b5645b9..4e2a8531f7 100644 --- a/src/patterns/guide/example-guide.njk +++ b/src/patterns/guide/example-guide.njk @@ -92,22 +92,35 @@ layout: ~ }) }}
-

It’s important you take part in the census. The information it gives has the power to make a real impact on our everyday lives.

The census is vital to all of us

The census helps us understand what our society needs now and what it’s likely to need in the future. The information it collects helps plan and fund services in your area. This could include transport, education and healthcare.

Charities also use census information to help get the funding they need. Businesses use it to decide where to set up, which creates job opportunities.

Its success could help you

Census 2021 will help give the best picture of the needs of everyone living in England and Wales.

A total of 94% of people took part in the last census, helping each area receive its share of public funding. Without the census, it would be much more difficult to provide the services you and your community need.

You must complete the census by law

You must complete the census by law. If you do not, or if you supply false information, you could be fined up to £1,000. Some questions are clearly labelled as voluntary. It is not an offence if you do not answer these.

+

It’s important you take part in the census. The information it gives has the power to make a real impact on our everyday lives.

+ +

The census is vital to all of us

+

The census helps us understand what our society needs now and what it’s likely to need in the future. The information it collects helps plan and fund services in your area. This could include transport, education and healthcare.

+

Charities also use census information to help get the funding they need. Businesses use it to decide where to set up, which creates job opportunities.

+ +

Its success could help you

+

Census 2021 will help give the best picture of the needs of everyone living in England and Wales.

+

A total of 94% of people took part in the last census, helping each area receive its share of public funding. Without the census, it would be much more difficult to provide the services you and your community need.

+ +

You must complete the census by law

+

You must complete the census by law. If you do not, or if you supply false information, you could be fined up to £1,000. Some questions are clearly labelled as voluntary. It is not an offence if you do not answer these.

+ +
{{- - onsContentPagination({ - "contentPaginationItems": [ - { - "rel": 'prev', - "text": 'Previous', - "url": '#', - "label": 'About the census' - }, - { - "rel": 'next', - "text": 'Next', - "url": '#', - "label": 'How your information is used' - } + onsContentPagination({ + "contentPaginationItems": [ + { + "rel": 'prev', + "text": 'Previous', + "url": '#', + "label": 'About the census' + }, + { + "rel": 'next', + "text": 'Next', + "url": '#', + "label": 'How your information is used' + } ] }) }}