Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Crown copyright notice to be removed #3876

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<span>` 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
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,16 @@
{% endif %}
</span>
</div>
{%- if params.copyright != false -%}
<div class="govuk-footer__meta-item">
<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/"
>
{%- if params.copyright.html or params.copyright.text -%}
{{ params.copyright.html | safe if params.copyright.html else params.copyright.text }}
{%- else -%}
© Crown copyright
{%- endif -%}
{{ (params.copyright.html | safe if params.copyright.html else params.copyright.text) | default("© Crown copyright", true) }}
</a>
</div>
{%- endif -%}
</div>
</div>
</footer>
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down