Skip to content

Commit

Permalink
rename html ogllink param to current naming standard
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccar committed Oct 7, 2024
1 parent 6afaba9 commit b647411
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/components/footer/_macro-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| cols | array`<FooterCol>` | false | An array of objects for each of the 3 allowed [footer columns](#footercol) |
| rows | array`<FooterRow>` | false | An array for the first [footer row](#footerrow) |
| legal | array`<LegalRow>` | false | An array of for the [row of legal links](#legalrow) |
| poweredBy | HTML | false | Any HTML to render an image for example embedded `<svg>` or `<img>` to override the default ONS logo |
| poweredBy | string | false | HTML to render an image for example embedded `<svg>` or `<img>` to override the default ONS logo |
| lang | string | false | Set the ISO language code for current page to display the correct language ONS logo. Defaults to “en”. |
| newTabWarning | string | false | Leading line of text to warn users that all footer links will open a new tab |
| OGLLink | object`<OGLLink>` | false | An object containing settings for the [Open Government Licence content](#ogllink). Set to “true” to display the default values for English and Welsh |
Expand All @@ -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 |
| link | 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 |
| link | 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
4 changes: 2 additions & 2 deletions src/components/footer/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,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. Helpful to add a margin utility class to control spacing. |
| large | HTML | false | 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 | 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 @@

## LogoObject

| Name | Type | Required | Description |
| --------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| logoImage | HTML or string | false | Any HTML to render an image for example embedded `<svg>` or `<img>`. Use 'ONS Logo' for the default ONS icon. |
| logoURL | string | false | Wraps the masthead logo in a link. Set the URL for the HTML `href` attribute for the link. |
| Name | Type | Required | Description |
| --------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| logoImage | HTML or string | false | HTML to render an image for example embedded `<svg>` or `<img>`. Use 'ONS Logo' for the default ONS icon. |
| logoURL | 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. Helpful to add a margin utility class to control spacing. |
| 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

0 comments on commit b647411

Please sign in to comment.