diff --git a/CHANGELOG.md b/CHANGELOG.md index 69708e7805..b9c3d86ac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,12 @@ These additional styles are not included if you use `govuk-font-tabular-numbers` This change was introduced in [pull request #4307: Refactor tabular number activation into their own mixin](https://github.com/alphagov/govuk-frontend/pull/4307) +#### Allow Crown copyright notice to be removed + +For non-GOV.UK branded websites, you can now remove the copyright notice and coat of arms from the [footer component](https://design-system.service.gov.uk/components/footer/) by setting the `copyright` Nunjucks option to `false`. + +This was added in [pull request #3876: Allow Crown copyright notice to be removed](https://github.com/alphagov/govuk-frontend/pull/3876). Thanks to [@paulrobertlloyd](https://github.com/paulrobertlloyd) for contributing this improvement. + ### Recommended changes #### Replace instances of `govuk-typography-responsive` with `govuk-font-size` diff --git a/packages/govuk-frontend/src/govuk/components/footer/footer.yaml b/packages/govuk-frontend/src/govuk/components/footer/footer.yaml index 615fc22f5d..4318105828 100644 --- a/packages/govuk-frontend/src/govuk/components/footer/footer.yaml +++ b/packages/govuk-frontend/src/govuk/components/footer/footer.yaml @@ -81,9 +81,9 @@ params: required: false description: If `text` is set, this is not required. If `html` is provided, the `text` option will be ignored. If neither are provided, the text for the Open Government Licence is used. The content licence is inside a `` element, so you can only add [phrasing content](https://html.spec.whatwg.org/#phrasing-content) to it. - name: copyright - type: object + type: object | boolean required: false - description: The copyright information in the footer component, this defaults to `"© Crown copyright"`. + description: The copyright information in the footer component that links to [The National Archives ‘Crown copyright’ page](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/). Defaults to the `text` option value. If you set this option to `false`, the whole copyright notice is removed, including the Royal coat of arms. params: - name: text type: string @@ -158,6 +158,11 @@ examples: copyright: text: '© Hawlfraint y Goron' + - name: with copyright notice removed + description: Crown copyright notice removed + options: + copyright: false + - name: with meta description: Secondary navigation with meta information relating to the site options: diff --git a/packages/govuk-frontend/src/govuk/components/footer/template.njk b/packages/govuk-frontend/src/govuk/components/footer/template.njk index 94784b50b0..1f6428e922 100644 --- a/packages/govuk-frontend/src/govuk/components/footer/template.njk +++ b/packages/govuk-frontend/src/govuk/components/footer/template.njk @@ -76,18 +76,16 @@ {% endif %} + {%- if params.copyright != false -%} + {%- endif -%} diff --git a/packages/govuk-frontend/src/govuk/components/footer/template.test.js b/packages/govuk-frontend/src/govuk/components/footer/template.test.js index b058a464a8..750233211c 100644 --- a/packages/govuk-frontend/src/govuk/components/footer/template.test.js +++ b/packages/govuk-frontend/src/govuk/components/footer/template.test.js @@ -243,6 +243,13 @@ describe('footer', () => { expect($copyrightMessage.text()).toContain('© Crown copyright') }) + it('can be removed', () => { + const $ = render('footer', examples['with copyright notice removed']) + + const $copyrightMessage = $('.govuk-footer__copyright-logo') + expect($copyrightMessage.length).toBeFalsy() + }) + it('can be customised with `text` parameter', () => { const $ = render( 'footer',