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

Rename html OGL Link param to current naming standard #3379

Merged
merged 5 commits into from
Oct 8, 2024
Merged
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
18 changes: 9 additions & 9 deletions src/components/footer/_macro-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

| Name | Type | Required | Description |
| ---- | ------ | --------------------------- | ----------------------------------------------------- |
| pre | string | true (unless `HTML` is set) | The text before the OGL link |
| url | string | true (unless `HTML` is set) | The URL for the HTML `href` attribute of the OGL link |
| text | string | true (unless `HTML` is set) | The text label for the OGL link |
| post | string | true (unless `HTML` is set) | The text after the OGL link |
| HTML | string | false | The alternative HTML for the OGL content |
| pre | string | true (unless `html` is set) | The text before the OGL link |
| url | string | true (unless `html` is set) | The URL for the HTML `href` attribute of the OGL link |
| text | string | true (unless `html` is set) | The text label for the OGL link |
| post | string | true (unless `html` is set) | The text after the OGL link |
| html | string | false | The alternative HTML for the OGL content |

## CopyrightDeclaration

Expand Down Expand Up @@ -69,7 +69,7 @@

## Logo

| Name | Type | Required | Description |
| --------- | -------------- | -------- | --------------------------------------------------------------------------------------- |
| logoImage | HTML or string | false | Any HTML to render an image for example embedded `<svg>` or `<img>`. |
| logoUrl | string | false | Wraps the extra logo in a link. Set the URL for the HTML `href` attribute for the link. |
| Name | Type | Required | Description |
| --------- | ------ | -------- | --------------------------------------------------------------------------------------- |
| logoImage | string | false | HTML to render an image for example embedded `<svg>` or `<img>`. |
| logoUrl | string | false | Wraps the extra logo in a link. Set the URL for the HTML `href` attribute for the link. |
4 changes: 2 additions & 2 deletions src/components/footer/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@
"iconType": 'ogl'
})
-}}
{% if params.oglLink.HTML %}
{{ params.oglLink.HTML | safe }}
{% if params.oglLink.html %}
{{ params.oglLink.html | safe }}
{% elif params.oglLink %}
{% from "components/external-link/_macro.njk" import onsExternalLink %}
{% if params.lang == 'cy' %}
Expand Down
4 changes: 2 additions & 2 deletions src/components/footer/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ describe('macro: footer', () => {
expect(iconsSpy.occurrences).toContainEqual(expect.objectContaining({ iconType: 'ogl' }));
});

it('renders raw HTML when `HTML` is provided', () => {
it('renders raw HTML when `html` is provided', () => {
const $ = cheerio.load(
renderComponent('footer', {
oglLink: {
...params.oglLink,
HTML: '<strong>Bold text.</strong>',
html: '<strong>Bold text.</strong>',
},
}),
);
Expand Down
16 changes: 8 additions & 8 deletions src/components/header/_macro-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
| Name | Type | Required | Description |
| ------------- | ----------------------- | -------- | ------------------------------------------------------------------------ |
| classes | string | false | Classes to be added to the masthead logo |
| large | HTML | false | Any HTML to render an image for example embedded `<svg>` or `<img>` |
precious-onyenaucheya-ons marked this conversation as resolved.
Show resolved Hide resolved
| small | HTML | false | Optionally provide a version of the logo more suited to mobile viewports |
| large | string | false | HTML to render an image for example embedded `<svg>` or `<img>` |
| small | string | false | Optionally provide a version of the logo more suited to mobile viewports |
| multipleLogos | object`<MultipleLogos>` | false | Allows for up to three logos to be used in the masthead |

## MultipleLogos
Expand All @@ -37,18 +37,18 @@

## Logo

| Name | Type | Required | Description |
| ----- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| image | HTML or string | false | Any HTML to render an image for example embedded `<svg>` or `<img>`. Use 'ONS Logo' for the default ONS icon. |
| url | string | false | Wraps the masthead logo in a link. Set the URL for the HTML `href` attribute for the link. |
| Name | Type | Required | Description |
| ----- | ------ | -------- | --------------------------------------------------------------------------------------------------------- |
| image | string | false | HTML to render an image for example embedded `<svg>` or `<img>`. Use 'ONS Logo' for the default ONS icon. |
| url | string | false | Wraps the masthead logo in a link. Set the URL for the HTML `href` attribute for the link. |

## TitleLogo

| Name | Type | Required | Description |
| ------- | ------ | -------- | ------------------------------------------------------------------------ |
| classes | string | false | Classes to be added to the masthead logo |
| large | HTML | true | Any HTML to render an image for example embedded `<svg>` or `<img>` |
| small | HTML | false | Optionally provide a version of the logo more suited to mobile viewports |
| large | string | true | HTML to render an image for example embedded `<svg>` or `<img>` |
| small | string | false | Optionally provide a version of the logo more suited to mobile viewports |

## ServiceLinks

Expand Down